Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieval of dstStatusField and optionally writing to file; add mapbilnr_nstod mapping #169

Merged
merged 7 commits into from
Mar 28, 2021
6 changes: 4 additions & 2 deletions mediator/esmFlds.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ module esmflds
integer , public, parameter :: map_glc2ocn_liq = 13 ! custom smoothing map to map liq from glc->ocn (cesm only)
integer , public, parameter :: map_glc2ocn_ice = 14 ! custom smoothing map to map ice from glc->ocn (cesm only)
integer , public, parameter :: mapfillv_bilnr = 15 ! fill value followed by bilinear
integer , public, parameter :: nmappers = 15
integer , public, parameter :: mapbilnr_nstod = 16 ! bilinear with nstod extrapolation
integer , public, parameter :: nmappers = 16

character(len=*) , public, parameter :: mapnames(nmappers) = &
(/'bilnr ',&
Expand All @@ -71,7 +72,8 @@ module esmflds
'rof2ocn_liq',&
'glc2ocn_ice',&
'glc2ocn_liq',&
'fillv_bilnr'/)
'fillv_bilnr',&
'bilnr_nstod'/)

!-----------------------------------------------
! Set coupling mode
Expand Down
2 changes: 1 addition & 1 deletion mediator/esmFldsExchange_hafs_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ subroutine esmFldsExchange_hafs_advt(gcomp, phase, rc)
call addfld(fldListTo(compatm)%flds, 'So_ofrac')

!----------------------------------------------------------
! to atm: surface temperatures from ocn
! to atm: surface temperatures from ocn
!----------------------------------------------------------
call addfld(fldListFr(compocn)%flds, 'So_t')
call addfld(fldListTo(compatm)%flds, 'So_t')
Expand Down
52 changes: 26 additions & 26 deletions mediator/fd_nems.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@
description: atmosphere export - latent heat flux conversion
- alias: Faox_evap
standard_name : mean_evap_rate
description: mediator calculation - atm/ocn specific humidity flux
description: mediator calculation - atm/ocn specific humidity flux
#
#-----------------------------------
# section: atmosphere fields that need to be defined but are not used
Expand Down Expand Up @@ -694,8 +694,8 @@
#-----------------------------------
#
- standard_name: sea_surface_height_above_sea_level
canonical_units: m
description: ww3 import
canonical_units: m
description: ww3 import
#
- standard_name: sea_surface_salinity
alias: s_surf
Expand All @@ -705,22 +705,22 @@
- standard_name: surface_eastward_sea_water_velocity
alias: ocn_current_zonal
canonical_units: m s-1
description: ww3 import
description: ww3 import
#
- standard_name: surface_northward_sea_water_velocity
alias: ocn_current_merid
canonical_units: m s-1
description: ww3 import
description: ww3 import
#
- standard_name: eastward_wind_at_10m_height
alias: inst_zonal_wind_height10m
canonical_units: m s-1
description: ww3 import
description: ww3 import
#
- standard_name: northward_wind_at_10m_height
alias: inst_merid_wind_height10m
canonical_units: m s-1
description: ww3 import
description: ww3 import
#
- standard_name: sea_ice_concentration
alias: ice_fraction
Expand All @@ -732,77 +732,77 @@
#
- standard_name: wave_induced_charnock_parameter
canonical_units: 1
description: ww3 export
description: ww3 export
#
- standard_name: wave_z0_roughness_length
canonical_units: 1
description: ww3 export
description: ww3 export
#
- standard_name: northward_stokes_drift_current
canonical_units: m s-1
description: ww3 export
description: ww3 export
#
- standard_name: eastward_stokes_drift_current
canonical_units: m s-1
description: ww3 export
description: ww3 export
#
- standard_name: eastward_partitioned_stokes_drift_1
canonical_units: m s-1
description: ww3 export
description: ww3 export
#
- standard_name: eastward_partitioned_stokes_drift_2
canonical_units: m s-1
description: ww3 export
description: ww3 export
#
- standard_name: eastward_partitioned_stokes_drift_3
canonical_units: m s-1
description: ww3 export
description: ww3 export
#
- standard_name: northward_partitioned_stokes_drift_1
canonical_units: m s-1
description: ww3 export
description: ww3 export
#
- standard_name: northward_partitioned_stokes_drift_2
canonical_units: m s-1
description: ww3 export
description: ww3 export
#
- standard_name: northward_partitioned_stokes_drift_3
canonical_units: m s-1
description: ww3 export
description: ww3 export
#
- standard_name: eastward_wave_bottom_current
canonical_units: m s-1
description: ww3 export
description: ww3 export
#
- standard_name: northward_wave_bottom_current
canonical_units: m s-1
description: ww3 export
description: ww3 export
#
- standard_name: wave_bottom_current_radian_frequency
canonical_units: rad s-1
description: ww3 export
description: ww3 export
#
- standard_name: eastward_wave_radiation_stress_gradient
canonical_units: Pa
description: ww3 export
description: ww3 export
#
- standard_name: northward_wave_radiation_stress_gradient
canonical_units: Pa
description: ww3 export
description: ww3 export
#
- standard_name: eastward_wave_radiation_stress
canonical_units: N m-1
description: ww3 export
description: ww3 export
#
- standard_name: eastward_northward_wave_radiation_stress
canonical_units: N m-1
description: ww3 export
description: ww3 export
#
- standard_name: wave_bottom_current_period
canonical_units: s
description: ww3 export
description: ww3 export
#
- standard_name: northward_wave_radiation_stress
canonical_units: Pa
description: ww3 export
description: ww3 export
#
7 changes: 6 additions & 1 deletion mediator/med.F90
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ subroutine InitializeIPDv03p1(gcomp, importState, exportState, clock, rc)

use ESMF , only : ESMF_GridComp, ESMF_State, ESMF_Clock, ESMF_SUCCESS, ESMF_LogFoundAllocError
use ESMF , only : ESMF_LogMsg_Info, ESMF_LogWrite
use ESMF , only : ESMF_END_ABORT, ESMF_Finalize
use NUOPC , only : NUOPC_AddNamespace, NUOPC_Advertise, NUOPC_AddNestedState
use NUOPC , only : NUOPC_CompAttributeGet, NUOPC_CompAttributeSet, NUOPC_CompAttributeAdd

Expand Down Expand Up @@ -749,12 +750,16 @@ subroutine InitializeIPDv03p1(gcomp, importState, exportState, clock, rc)
if (trim(coupling_mode) == 'cesm') then
call esmFldsExchange_cesm(gcomp, phase='advertise', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else if (trim(coupling_mode(1:4)) == 'nems') then
else if (trim(coupling_mode) == 'nems_orig' .or. trim(coupling_mode) == 'nems_frac' &
.or. trim(coupling_mode) == 'nems_orig_data') then
call esmFldsExchange_nems(gcomp, phase='advertise', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else if (trim(coupling_mode(1:4)) == 'hafs') then
call esmFldsExchange_hafs(gcomp, phase='advertise', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
else
call ESMF_LogWrite(trim(coupling_mode)//' is not a valid coupling_mode', ESMF_LOGMSG_INFO)
call ESMF_Finalize(endflag=ESMF_END_ABORT)
end if

!------------------
Expand Down
14 changes: 7 additions & 7 deletions mediator/med_diag_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module med_diag_mod
use ESMF , only : ESMF_GridComp, ESMF_Clock, ESMF_Time
use ESMF , only : ESMF_VM, ESMF_VMReduce, ESMF_REDUCE_SUM
use ESMF , only : ESMF_GridCompGet, ESMF_ClockGet, ESMF_TimeGet
use ESMF , only : ESMF_Alarm, ESMF_ClockGetAlarm, ESMF_AlarmIsRinging, ESMF_AlarmRingerOff
use ESMF , only : ESMF_Alarm, ESMF_ClockGetAlarm, ESMF_AlarmIsRinging, ESMF_AlarmRingerOff
use ESMF , only : ESMF_FieldBundle, ESMF_Field, ESMF_FieldGet
use shr_const_mod , only : shr_const_rearth, shr_const_pi, shr_const_latice
use shr_const_mod , only : shr_const_ice_ref_sal, shr_const_ocn_ref_sal, shr_const_isspval
Expand Down Expand Up @@ -800,7 +800,7 @@ subroutine diag_atm_wiso_recv(FB, fldname, nf_16O, nf_18O, nf_HDO, areas, lats,
integer , intent(out) :: rc
! local variables
integer :: n, ip
type(ESMF_Field) :: lfield
type(ESMF_Field) :: lfield
real(r8), pointer :: data(:,:) => null()
! ------------------------------------------------------------------
rc = ESMF_SUCCESS
Expand Down Expand Up @@ -857,7 +857,7 @@ subroutine diag_atm_wiso_send(FB, fldname, nf_16O, nf_18O, nf_HDO, areas, lats,
integer , intent(out) :: rc
! local variables
integer :: n, ip
type(ESMF_Field) :: lfield
type(ESMF_Field) :: lfield
real(r8), pointer :: data(:,:) => null()
! ------------------------------------------------------------------
rc = ESMF_SUCCESS
Expand Down Expand Up @@ -1575,7 +1575,7 @@ subroutine diag_ice_recv(FB, fldname, nf, areas, lats, ifrac, budget, minus, sca
integer , intent(out) :: rc
! local variables
integer :: n, ip
type(ESMF_Field) :: lfield
type(ESMF_Field) :: lfield
real(r8), pointer :: data(:) => null()
! ------------------------------------------------------------------
rc = ESMF_SUCCESS
Expand Down Expand Up @@ -1621,7 +1621,7 @@ subroutine diag_ice_recv_wiso(FB, fldname, nf_16O, nf_18O, nf_HDO, areas, lats,
integer , intent(out) :: rc
! local variables
integer :: n, ip
type(ESMF_Field) :: lfield
type(ESMF_Field) :: lfield
real(r8), pointer :: data(:,:) => null()
! ------------------------------------------------------------------
rc = ESMF_SUCCESS
Expand Down Expand Up @@ -1754,7 +1754,7 @@ subroutine diag_ice_send(FB, fldname, nf, areas, lats, ifrac, budget, rc)
integer , intent(out) :: rc
! local variables
integer :: n, ip
type(ESMF_Field) :: lfield
type(ESMF_Field) :: lfield
real(r8), pointer :: data(:) => null()
! ------------------------------------------------------------------
rc = ESMF_SUCCESS
Expand Down Expand Up @@ -1788,7 +1788,7 @@ subroutine diag_ice_send_wiso(FB, fldname, nf_16O, nf_18O, nf_HDO, areas, lats,

! local variables
integer :: n, ip
type(ESMF_Field) :: lfield
type(ESMF_Field) :: lfield
real(r8), pointer :: data(:,:) => null()
! ------------------------------------------------------------------
rc = ESMF_SUCCESS
Expand Down
4 changes: 2 additions & 2 deletions mediator/med_fraction_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ subroutine med_fraction_init(gcomp, rc)
end if

!---------------------------------------
! Set 'ofrac' in FBFrac(compocn)
! Set 'ofrac' in FBFrac(compocn)
!---------------------------------------

if (is_local%wrap%comp_present(compocn)) then
Expand Down Expand Up @@ -681,7 +681,7 @@ subroutine med_fraction_set(gcomp, rc)
! The model mask is normally assumed to be an selected ocean mask from a fully coupled run
! So in it is (1-land fraction) on the atm grid

! set ifrac
! set ifrac
if (associated(ifrac)) then
ifrac(:) = Si_ifrac(:) * Si_imask(:)
endif
Expand Down
16 changes: 8 additions & 8 deletions mediator/med_io_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ subroutine med_io_init(gcomp, rc)
call ESMF_VMGet(vm, mpiCommunicator=comm, localPet=localPet, petCount=petCount, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

! query component specific PIO attributes
! query component specific PIO attributes
! pio_netcdf_format
call NUOPC_CompAttributeGet(gcomp, name='pio_netcdf_format', value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down Expand Up @@ -212,9 +212,9 @@ subroutine med_io_init(gcomp, rc)
if (isPresent .and. isSet) then
cvalue = ESMF_UtilStringUpperCase(cvalue)
if (trim(cvalue) .eq. 'NETCDF') then
pio_iotype = PIO_IOTYPE_NETCDF
pio_iotype = PIO_IOTYPE_NETCDF
else if (trim(cvalue) .eq. 'PNETCDF') then
pio_iotype = PIO_IOTYPE_PNETCDF
pio_iotype = PIO_IOTYPE_PNETCDF
else if (trim(cvalue) .eq. 'NETCDF4C') then
pio_iotype = PIO_IOTYPE_NETCDF4C
else if (trim(cvalue) .eq. 'NETCDF4P') then
Expand Down Expand Up @@ -276,7 +276,7 @@ subroutine med_io_init(gcomp, rc)
write(logunit,*) ' parallel io requires at least two io pes - following parameters are updated:'
write(logunit,*) trim(subname), ' : pio_stride = ', pio_stride
write(logunit,*) trim(subname), ' : pio_numiotasks = ', pio_numiotasks
end if
end if
endif

! check/set/correct io pio parameters
Expand All @@ -294,7 +294,7 @@ subroutine med_io_init(gcomp, rc)
end if
if (pio_stride == 1) then
pio_root = 0
endif
endif

if (pio_root + (pio_stride)*(pio_numiotasks-1) >= petCount .or. &
pio_stride <= 0 .or. pio_numiotasks <= 0 .or. pio_root < 0 .or. pio_root > petCount-1) then
Expand Down Expand Up @@ -366,8 +366,8 @@ subroutine med_io_init(gcomp, rc)
! set PIO debug level
call pio_setdebuglevel(pio_debug_level)

! query shared PIO rearranger attributes
! pio_rearr_comm_type
! query shared PIO rearranger attributes
! pio_rearr_comm_type
call NUOPC_CompAttributeGet(gcomp, name='pio_rearr_comm_type', value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

Expand All @@ -386,7 +386,7 @@ subroutine med_io_init(gcomp, rc)
cvalue = 'P2P'
pio_rearr_comm_type = PIO_REARR_COMM_P2P
end if
if (localPet == 0) write(logunit,*) trim(subname), ' : pio_rearr_comm_type = ', trim(cvalue), pio_rearr_comm_type
if (localPet == 0) write(logunit,*) trim(subname), ' : pio_rearr_comm_type = ', trim(cvalue), pio_rearr_comm_type

! pio_rearr_comm_fcd
call NUOPC_CompAttributeGet(gcomp, name='pio_rearr_comm_fcd', value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
Expand Down
Loading