Skip to content

Commit

Permalink
Add CICE 6 albedos (#55)
Browse files Browse the repository at this point in the history
* add albedo fields ice->atm
* update to ESCOMP/master
* check do_budgets config before initializing diags
  • Loading branch information
DeniseWorthen authored Jul 28, 2021
1 parent d5428cf commit adca0ed
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 40 deletions.
2 changes: 1 addition & 1 deletion cime_config/buildexe
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""
build model executable
Expand Down
2 changes: 1 addition & 1 deletion cime_config/buildnml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""Namelist creator for CIME's driver.
"""
import os, sys
Expand Down
26 changes: 23 additions & 3 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@

<entry id="STOP_OPTION">
<type>char</type>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end</valid_values>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,end</valid_values>
<default_value>ndays</default_value>
<group>run_begin_stop_restart</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -363,7 +363,7 @@

<entry id="REST_OPTION">
<type>char</type>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end</valid_values>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,end</valid_values>
<default_value>$STOP_OPTION</default_value>
<group>run_begin_stop_restart</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -1862,6 +1862,26 @@
<desc>pes or cores per node for accounting purposes </desc>
</entry>

<entry id="NGPUS_PER_NODE">
<type>integer</type>
<default_value>0</default_value>
<values>
<value compiler="pgi-gpu">1</value>
<value compiler="nvhpc-gpu">1</value>
</values>
<group>mach_pes</group>
<file>env_mach_pes.xml</file>
<desc> Number of GPUs per node used for simulation </desc>
</entry>

<entry id="MAX_GPUS_PER_NODE">
<type>integer</type>
<default_value>0</default_value>
<group>mach_pes_last</group>
<file>env_mach_pes.xml</file>
<desc>maximum number of GPUs allowed per node </desc>
</entry>

<entry id="COSTPES_PER_NODE">
<type>integer</type>
<default_value>$MAX_MPITASKS_PER_NODE</default_value>
Expand Down Expand Up @@ -2293,7 +2313,7 @@

<entry id="HIST_OPTION">
<type>char</type>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end</valid_values>
<valid_values>none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,end</valid_values>
<default_value>never</default_value>
<group>run_drv_history</group>
<file>env_run.xml</file>
Expand Down
2 changes: 1 addition & 1 deletion cime_config/runseq/driver_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Inherit from the dictionary class
class DriverConfig(dict):
Expand Down
2 changes: 1 addition & 1 deletion cime_config/runseq/gen_runseq.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

class RunSeq:
def __init__(self, outfile):
Expand Down
2 changes: 1 addition & 1 deletion cime_config/runseq/runseq_D.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os, shutil, sys
from CIME.utils import expect
Expand Down
2 changes: 1 addition & 1 deletion cime_config/runseq/runseq_TG.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os, shutil, sys
from CIME.utils import expect
Expand Down
2 changes: 1 addition & 1 deletion cime_config/runseq/runseq_general.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os, shutil, sys
from CIME.utils import expect
Expand Down
16 changes: 12 additions & 4 deletions mediator/esmFldsExchange_nems_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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')
Expand Down
17 changes: 12 additions & 5 deletions mediator/med.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 3 additions & 21 deletions nuopc_cap_share/nuopc_shr_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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)'
!-------------------------------------------------------------------------------

Expand All @@ -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)

Expand Down

0 comments on commit adca0ed

Please sign in to comment.