Skip to content

Commit

Permalink
Update CMEPS to latest ESCOMP/master (ESCOMP#72)
Browse files Browse the repository at this point in the history
* add support for external land component
* update exchange fields for nems to include land
* remove physparam.f in MED_typedefs.meta

Ufuk Turuncoglu <[email protected]>
  • Loading branch information
DeniseWorthen authored Oct 28, 2022
1 parent f9f7541 commit aabe844
Show file tree
Hide file tree
Showing 18 changed files with 1,023 additions and 1,724 deletions.
6 changes: 3 additions & 3 deletions cesm/driver/esm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
use mpi , only : MPI_COMM_NULL, mpi_comm_size
#endif
use mct_mod , only : mct_world_init
use shr_pio_mod , only : shr_pio_init, shr_pio_component_init
use driver_pio_mod , only : driver_pio_init, driver_pio_component_init

#ifdef MED_PRESENT
use med_internalstate_mod , only : med_id
Expand Down Expand Up @@ -934,7 +934,7 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)

! Initialize PIO
! This reads in the pio parameters that are independent of component
call shr_pio_init(driver, rc=rc)
call driver_pio_init(driver, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

allocate(comms(componentCount+1), comps(componentCount+1))
Expand Down Expand Up @@ -1182,7 +1182,7 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
enddo
! Read in component dependent PIO parameters and initialize
! IO systems
call shr_pio_component_init(driver, size(comps), rc)
call driver_pio_component_init(driver, size(comps), rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

! Initialize MCT (this is needed for data models and cice prescribed capability)
Expand Down
53 changes: 27 additions & 26 deletions cesm/driver/esm_time_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ module esm_time_mod

! Clock and alarm options
character(len=*), private, parameter :: &
optNONE = "none" , &
optNever = "never" , &
optNSteps = "nsteps" , &
optNSeconds = "nseconds" , &
optNMinutes = "nminutes" , &
optNHours = "nhours" , &
optNDays = "ndays" , &
optNMonths = "nmonths" , &
optNYears = "nyears" , &
optMonthly = "monthly" , &
optYearly = "yearly" , &
optDate = "date" , &
optNONE = "none" , &
optNever = "never" , &
optNSteps = "nstep" , &
optNSeconds = "nsecond" , &
optNMinutes = "nminute" , &
optNHours = "nhour" , &
optNDays = "nday" , &
optNMonths = "nmonth" , &
optNYears = "nyear" , &
optMonthly = "monthly" , &
optYearly = "yearly" , &
optDate = "date" , &
optGLCCouplingPeriod = "glc_coupling_period"

! Module data
Expand Down Expand Up @@ -434,13 +434,14 @@ subroutine esm_time_alarmInit( clock, alarm, option, &
rc = ESMF_FAILURE
return
end if
else if (trim(option) == optNSteps .or. &
trim(option) == optNSeconds .or. &
trim(option) == optNMinutes .or. &
trim(option) == optNHours .or. &
trim(option) == optNDays .or. &
trim(option) == optNMonths .or. &
trim(option) == optNYears) then
else if (&
trim(option) == optNSteps .or. trim(option) == trim(optNSteps)//'s' .or. &
trim(option) == optNSeconds .or. trim(option) == trim(optNSeconds)//'s' .or. &
trim(option) == optNMinutes .or. trim(option) == trim(optNMinutes)//'s' .or. &
trim(option) == optNHours .or. trim(option) == trim(optNHours)//'s' .or. &
trim(option) == optNDays .or. trim(option) == trim(optNDays)//'s' .or. &
trim(option) == optNMonths .or. trim(option) == trim(optNMonths)//'s' .or. &
trim(option) == optNYears .or. trim(option) == trim(optNYears)//'s' ) then
if (.not.present(opt_n)) then
call ESMF_LogWrite(subname//trim(option)//' requires opt_n', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
Expand All @@ -451,7 +452,7 @@ subroutine esm_time_alarmInit( clock, alarm, option, &
rc = ESMF_FAILURE
return
end if
end if
end if

! Determine inputs for call to create alarm
selectcase (trim(option))
Expand Down Expand Up @@ -479,36 +480,36 @@ subroutine esm_time_alarmInit( clock, alarm, option, &
if (ChkErr(rc,__LINE__,u_FILE_u)) return
update_nextalarm = .false.

case (optNSteps)
case (optNSteps,trim(optNSteps)//'s')
call ESMF_ClockGet(clock, TimeStep=AlarmInterval, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
update_nextalarm = .true.

case (optNSeconds)
case (optNSeconds,trim(optNSeconds)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, s=1, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
update_nextalarm = .true.

case (optNMinutes)
case (optNMinutes,trim(optNMinutes)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, s=60, rc=rc)
AlarmInterval = AlarmInterval * opt_n
update_nextalarm = .true.

case (optNHours)
case (optNHours,trim(optNHours)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, s=3600, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
update_nextalarm = .true.

case (optNDays)
case (optNDays,trim(optNDays)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, d=1, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
update_nextalarm = .true.

case (optNMonths)
case (optNMonths,trim(optNMonths)//'s')
call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
AlarmInterval = AlarmInterval * opt_n
Expand Down
20 changes: 17 additions & 3 deletions cesm/flux_atmocn/shr_flux_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ end subroutine shr_flux_adjust_constants
! Thomas Toniazzo (Bjerknes Centre, Bergen) ”
!===============================================================================
SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
& qbot ,s16O ,sHDO ,s18O ,rbot , &
& tbot ,us ,vs , &
& qbot ,s16O ,sHDO ,s18O ,rbot, &
& tbot ,us ,vs, pslv, &
& ts ,mask , seq_flux_atmocn_minwind, &
& sen ,lat ,lwup , &
& r16O, rhdo, r18O, &
Expand Down Expand Up @@ -169,6 +169,7 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
real(R8) ,intent(in) :: r18O (nMax) ! ocn H218O tracer ratio/Rstd
real(R8) ,intent(in) :: rbot (nMax) ! atm air density (kg/m^3)
real(R8) ,intent(in) :: tbot (nMax) ! atm T (K)
real(R8) ,intent(in) :: pslv (nMax) ! atm sea level pressure(Pa)
real(R8) ,intent(in) :: us (nMax) ! ocn u-velocity (m/s)
real(R8) ,intent(in) :: vs (nMax) ! ocn v-velocity (m/s)
real(R8) ,intent(in) :: ts (nMax) ! ocn temperature (K)
Expand Down Expand Up @@ -553,9 +554,22 @@ SUBROUTINE flux_atmOcn(logunit, nMax ,zbot ,ubot ,vbot ,thbot , &
endif
ENDDO

else if (ocn_surface_flux_scheme .eq. 2) then

call flux_atmOcn_UA(logunit,&
nMax, zbot, ubot, vbot, thbot, &
qbot, s16O, sHDO, s18O, rbot, &
tbot, pslv, us, vs, &
ts, mask, sen, lat, lwup, &
r16O, rhdo, r18O, &
evap, evap_16O, evap_HDO, evap_18O, &
taux, tauy, tref, qref, &
duu10n, ustar_sv, re_sv, ssq_sv, &
missval)

else

call shr_sys_abort(subName//" subroutine flux_atmOcn requires ocn_surface_flux_scheme = 0 or 1")
call shr_sys_abort(subName//" subroutine flux_atmOcn requires ocn_surface_flux_scheme = 0, 1 or 2")

endif !! ocn_surface_flux_scheme

Expand Down
Loading

0 comments on commit aabe844

Please sign in to comment.