diff --git a/cime_config/buildexe b/cime_config/buildexe index 476bee765..52640d30b 100755 --- a/cime_config/buildexe +++ b/cime_config/buildexe @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ build model executable diff --git a/cime_config/buildnml b/cime_config/buildnml index 00b3dad35..28e83bbd9 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Namelist creator for CIME's driver. """ import os, sys diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 8f6030c52..ba73c96d6 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -331,7 +331,7 @@ char - none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end + none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,end ndays run_begin_stop_restart env_run.xml @@ -363,7 +363,7 @@ char - none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end + none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,end $STOP_OPTION run_begin_stop_restart env_run.xml @@ -1862,6 +1862,26 @@ pes or cores per node for accounting purposes + + integer + 0 + + 1 + 1 + + mach_pes + env_mach_pes.xml + Number of GPUs per node used for simulation + + + + integer + 0 + mach_pes_last + env_mach_pes.xml + maximum number of GPUs allowed per node + + integer $MAX_MPITASKS_PER_NODE @@ -2293,7 +2313,7 @@ char - none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end + none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,end never run_drv_history env_run.xml diff --git a/cime_config/runseq/driver_config.py b/cime_config/runseq/driver_config.py index 8251eeebb..c2b5556ba 100644 --- a/cime_config/runseq/driver_config.py +++ b/cime_config/runseq/driver_config.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Inherit from the dictionary class class DriverConfig(dict): diff --git a/cime_config/runseq/gen_runseq.py b/cime_config/runseq/gen_runseq.py index 29d1616bf..3caa4feb9 100644 --- a/cime_config/runseq/gen_runseq.py +++ b/cime_config/runseq/gen_runseq.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 class RunSeq: def __init__(self, outfile): diff --git a/cime_config/runseq/runseq_D.py b/cime_config/runseq/runseq_D.py index 3d108fe30..916a8628b 100644 --- a/cime_config/runseq/runseq_D.py +++ b/cime_config/runseq/runseq_D.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os, shutil, sys from CIME.utils import expect diff --git a/cime_config/runseq/runseq_TG.py b/cime_config/runseq/runseq_TG.py index 861d127d7..c0bb4ab92 100644 --- a/cime_config/runseq/runseq_TG.py +++ b/cime_config/runseq/runseq_TG.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os, shutil, sys from CIME.utils import expect diff --git a/cime_config/runseq/runseq_general.py b/cime_config/runseq/runseq_general.py index db323b3c2..f565f8fdf 100644 --- a/cime_config/runseq/runseq_general.py +++ b/cime_config/runseq/runseq_general.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os, shutil, sys from CIME.utils import expect diff --git a/mediator/esmFldsExchange_nems_mod.F90 b/mediator/esmFldsExchange_nems_mod.F90 index c46635818..f6d88ab46 100644 --- a/mediator/esmFldsExchange_nems_mod.F90 +++ b/mediator/esmFldsExchange_nems_mod.F90 @@ -106,10 +106,6 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc) end if ! unused fields from ice - but that are needed to be realized by the cice cap - call addfld(fldListFr(compice)%flds, 'Si_avsdf') - call addfld(fldListFr(compice)%flds, 'Si_avsdr') - call addfld(fldListFr(compice)%flds, 'Si_anidf') - call addfld(fldListFr(compice)%flds, 'Si_anidr') call addfld(fldListFr(compice)%flds, 'Faii_evap') call addfld(fldListFr(compice)%flds, 'mean_sw_pen_to_ocn') @@ -145,6 +141,18 @@ subroutine esmFldsExchange_nems(gcomp, phase, rc) end do deallocate(flds) + allocate(flds(4)) + flds = (/'avsdr ', 'avsdf ', & + 'anidr ', 'anidf '/) + do n = 1,size(flds) + fldname = 'Si_'//trim(flds(n)) + call addfld(fldListFr(compice)%flds, trim(fldname)) + call addfld(fldListTo(compatm)%flds, trim(fldname)) + call addmap(fldListFr(compice)%flds, trim(fldname), compatm, maptype, 'ifrac', 'unset') + call addmrg(fldListTo(compatm)%flds, trim(fldname), mrg_from=compice, mrg_fld=trim(fldname), mrg_type='copy') + end do + deallocate(flds) + ! to atm: unmerged surface temperatures from ocn call addfld(fldListFr(compocn)%flds, 'So_t') call addfld(fldListTo(compatm)%flds, 'So_t') diff --git a/mediator/med.F90 b/mediator/med.F90 index 53c8698eb..f2e074034 100644 --- a/mediator/med.F90 +++ b/mediator/med.F90 @@ -1758,6 +1758,7 @@ subroutine DataInitialize(gcomp, rc) type(ESMF_Field) :: field type(ESMF_StateItem_Flag) :: itemType logical :: atCorrectTime, connected + logical :: isPresent, isSet integer :: n1,n2,n,ns integer :: nsrc,ndst integer :: cntn1, cntn2 @@ -2420,11 +2421,17 @@ subroutine DataInitialize(gcomp, rc) !--------------------------------------- ! Initialize mediator water/heat budget diags !--------------------------------------- - call med_diag_init(gcomp, rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call med_diag_zero(mode='all', rc=rc) - - if (ChkErr(rc,__LINE__,u_FILE_u)) return + call NUOPC_CompAttributeGet(gcomp, name="do_budgets", value=cvalue, & + isPresent=isPresent, isSet=isSet, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + if (isPresent .and. isSet) then + if (trim(cvalue) .eq. '.true.') then + call med_diag_init(gcomp, rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + call med_diag_zero(mode='all', rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + endif + endif !--------------------------------------- ! read mediator restarts diff --git a/nuopc_cap_share/nuopc_shr_methods.F90 b/nuopc_cap_share/nuopc_shr_methods.F90 index 8d3283a4f..8cbf91056 100644 --- a/nuopc_cap_share/nuopc_shr_methods.F90 +++ b/nuopc_cap_share/nuopc_shr_methods.F90 @@ -60,8 +60,7 @@ module nuopc_shr_methods optNYear = "nyear" , & optMonthly = "monthly" , & optYearly = "yearly" , & - optDate = "date" , & - optIfdays0 = "ifdays0" + optDate = "date" ! Module data integer, parameter :: SecPerDay = 86400 ! Seconds per day @@ -572,22 +571,6 @@ subroutine alarmInit( clock, alarm, option, & if (chkerr(rc,__LINE__,u_FILE_u)) return update_nextalarm = .false. - case (optIfdays0) - if (.not. present(opt_ymd)) then - call shr_sys_abort(subname//trim(option)//' requires opt_ymd') - end if - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call ESMF_TimeSet( NextAlarm, yy=cyy, mm=cmm, dd=opt_n, s=0, calendar=cal, rc=rc ) - if (chkerr(rc,__LINE__,u_FILE_u)) return - update_nextalarm = .true. - case (optNSteps) if (.not.present(opt_n)) then call shr_sys_abort(subname//trim(option)//' requires opt_n') @@ -808,7 +791,6 @@ subroutine timeInit( Time, ymd, cal, tod, rc) ! local variables integer :: year, mon, day ! year, month, day as integers integer :: tdate ! temporary date - integer :: date ! coded-date (yyyymmdd) character(len=*), parameter :: subname='(timeInit)' !------------------------------------------------------------------------------- @@ -818,9 +800,9 @@ subroutine timeInit( Time, ymd, cal, tod, rc) call shr_sys_abort( subname//'ERROR yymmdd is a negative number or time-of-day out of bounds' ) end if - tdate = abs(date) + tdate = abs(ymd) year = int(tdate/10000) - if (date < 0) year = -year + if (ymd < 0) year = -year mon = int( mod(tdate,10000)/ 100) day = mod(tdate, 100)