diff --git a/mediator/CMakeLists.txt b/mediator/CMakeLists.txt index b65004c37..4b35db94b 100644 --- a/mediator/CMakeLists.txt +++ b/mediator/CMakeLists.txt @@ -17,7 +17,8 @@ set(SRCFILES esmFldsExchange_cesm_mod.F90 med_fraction_mod.F90 med_phases_post_ocn_mod.F90 med_phases_ocnalb_mod.F90 med_phases_post_atm_mod.F90 med_phases_post_ice_mod.F90 med_phases_post_lnd_mod.F90 med_phases_post_glc_mod.F90 - med_phases_post_rof_mod.F90 med_phases_post_wav_mod.F90) + med_phases_post_rof_mod.F90 med_phases_post_wav_mod.F90 + med_ufs_trace_wrapper.F90) foreach(FILE ${SRCFILES}) if(EXISTS "${CASEROOT}/SourceMods/src.cmeps/${FILE}") diff --git a/mediator/esmFldsExchange_hafs_mod.F90 b/mediator/esmFldsExchange_hafs_mod.F90 index 0515c8707..7d997699f 100644 --- a/mediator/esmFldsExchange_hafs_mod.F90 +++ b/mediator/esmFldsExchange_hafs_mod.F90 @@ -30,24 +30,24 @@ module esmFldsExchange_hafs_mod __FILE__ type gcomp_attr - character(len=CX) :: atm2ocn_fmap = 'unset' - character(len=CX) :: atm2ocn_smap = 'unset' - character(len=CX) :: atm2ocn_vmap = 'unset' - character(len=CX) :: atm2wav_smap = 'unset' - character(len=CX) :: ocn2atm_fmap = 'unset' - character(len=CX) :: ocn2atm_smap = 'unset' - character(len=CX) :: ocn2wav_smap = 'unset' - character(len=CX) :: wav2ocn_smap = 'unset' - character(len=CX) :: wav2atm_smap = 'unset' - character(len=CS) :: mapnorm = 'one' - logical :: atm_present = .false. - logical :: ocn_present = .false. - logical :: wav_present = .false. - end type - -!=============================================================================== + character(len=CX) :: atm2ocn_fmap = 'unset' + character(len=CX) :: atm2ocn_smap = 'unset' + character(len=CX) :: atm2ocn_vmap = 'unset' + character(len=CX) :: atm2wav_smap = 'unset' + character(len=CX) :: ocn2atm_fmap = 'unset' + character(len=CX) :: ocn2atm_smap = 'unset' + character(len=CX) :: ocn2wav_smap = 'unset' + character(len=CX) :: wav2ocn_smap = 'unset' + character(len=CX) :: wav2atm_smap = 'unset' + character(len=CS) :: mapnorm = 'one' + logical :: atm_present = .false. + logical :: ocn_present = .false. + logical :: wav_present = .false. + end type gcomp_attr + + !=============================================================================== contains -!=============================================================================== + !=============================================================================== subroutine esmFldsExchange_hafs(gcomp, phase, rc) @@ -64,19 +64,19 @@ subroutine esmFldsExchange_hafs(gcomp, phase, rc) rc = ESMF_SUCCESS if (phase == 'advertise') then - call esmFldsExchange_hafs_advt(gcomp, phase, rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return + call esmFldsExchange_hafs_advt(gcomp, phase, rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return elseif (phase == 'fieldcheck') then - call esmFldsExchange_hafs_fchk(gcomp, phase, rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return + call esmFldsExchange_hafs_fchk(gcomp, phase, rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return elseif (phase == 'initialize') then - call esmFldsExchange_hafs_init(gcomp, phase, rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return + call esmFldsExchange_hafs_init(gcomp, phase, rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return else - call ESMF_LogSetError(ESMF_FAILURE, & - msg=trim(subname)//": Phase is set to "//trim(phase), & - line=__LINE__, file=__FILE__, rcToReturn=rc) - return ! bail out + call ESMF_LogSetError(ESMF_FAILURE, & + msg=trim(subname)//": Phase is set to "//trim(phase), & + line=__LINE__, file=__FILE__, rcToReturn=rc) + return ! bail out endif call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO) @@ -115,11 +115,11 @@ subroutine esmFldsExchange_hafs_advt(gcomp, phase, rc) !===================================================================== call NUOPC_CompAttributeGet(gcomp, name='ScalarFieldName', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldName", & - value=cvalue, rc=rc) + value=cvalue, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return do n = 1,ncomps call addfld_from(n, trim(cvalue)) @@ -150,13 +150,12 @@ subroutine esmFldsExchange_hafs_advt(gcomp, phase, rc) !---------------------------------------------------------- ! from med: ocean albedos (not sent to the ATM in UFS). !---------------------------------------------------------- - if (trim(coupling_mode) == 'hafs.mom6') then - if (phase == 'advertise') then - call addfld_ocnalb('So_avsdr') - call addfld_ocnalb('So_avsdf') - call addfld_ocnalb('So_anidr') - call addfld_ocnalb('So_anidf') - end if + + if (phase == 'advertise') then + call addfld_ocnalb('So_avsdr') + call addfld_ocnalb('So_avsdf') + call addfld_ocnalb('So_anidr') + call addfld_ocnalb('So_anidf') end if !===================================================================== @@ -167,27 +166,16 @@ subroutine esmFldsExchange_hafs_advt(gcomp, phase, rc) ! to atm: surface temperatures from ocn ! --------------------------------------------------------------------- if (hafs_attr%atm_present .and. hafs_attr%ocn_present) then - if (trim(coupling_mode) == 'hafs') then - allocate(S_flds(1)) - S_flds = (/'So_t'/) ! sea_surface_temperature - do n = 1,size(S_flds) - fldname = trim(S_flds(n)) - call addfld_from(compocn, trim(fldname)) - call addfld_to(compatm, trim(fldname)) - end do - deallocate(S_flds) - else - allocate(S_flds(3)) - S_flds = (/'So_t', & ! sea_surface_temperature - 'So_u', & ! surface zonal current - 'So_v'/) ! surface meridional current - do n = 1,size(S_flds) - fldname = trim(S_flds(n)) - call addfld_from(compocn, trim(fldname)) - call addfld_to(compatm, trim(fldname)) - end do - deallocate(S_flds) - end if + allocate(S_flds(3)) + S_flds = (/'So_t', & ! sea_surface_temperature + 'So_u', & ! surface zonal current + 'So_v'/) ! surface meridional current + do n = 1,size(S_flds) + fldname = trim(S_flds(n)) + call addfld_from(compocn, trim(fldname)) + call addfld_to(compatm, trim(fldname)) + end do + deallocate(S_flds) end if ! --------------------------------------------------------------------- @@ -212,84 +200,50 @@ subroutine esmFldsExchange_hafs_advt(gcomp, phase, rc) ! to ocn: state fields ! --------------------------------------------------------------------- if (hafs_attr%atm_present .and. hafs_attr%ocn_present) then - if (trim(coupling_mode) == 'hafs') then - allocate(S_flds(6)) - S_flds = (/'Sa_u10m', & ! inst_zonal_wind_height10m - 'Sa_v10m', & ! inst_merid_wind_height10m - 'Sa_t2m ', & ! inst_temp_height2m - 'Sa_q2m ', & ! inst_spec_humid_height2m - 'Sa_pslv', & ! inst_pres_height_surface - 'Sa_tskn' /) ! inst_temp_height_surface - do n = 1,size(S_flds) - fldname = trim(S_flds(n)) - call addfld_from(compatm, trim(fldname)) - call addfld_to(compocn, trim(fldname)) - end do - deallocate(S_flds) - else - allocate(S_flds(1)) - S_flds = (/'Sa_pslv'/) ! inst_pres_height_surface - do n = 1,size(S_flds) - fldname = trim(S_flds(n)) - call addfld_from(compatm, trim(fldname)) - call addfld_to(compocn, trim(fldname)) - end do - deallocate(S_flds) - end if + allocate(S_flds(1)) + S_flds = (/'Sa_pslv'/) ! inst_pres_height_surface + do n = 1,size(S_flds) + fldname = trim(S_flds(n)) + call addfld_from(compatm, trim(fldname)) + call addfld_to(compocn, trim(fldname)) + end do + deallocate(S_flds) end if ! --------------------------------------------------------------------- ! to ocn: flux fields ! --------------------------------------------------------------------- if (hafs_attr%atm_present .and. hafs_attr%ocn_present) then - if (trim(coupling_mode) == 'hafs') then - allocate(F_flds(7,2)) - F_flds(1,:) = (/'Faxa_taux ','Faxa_taux '/) ! inst_zonal_moment_flx_atm - F_flds(2,:) = (/'Faxa_tauy ','Faxa_tauy '/) ! inst_merid_moment_flx_atm - F_flds(3,:) = (/'Faxa_rain ','Faxa_rain '/) ! inst_prec_rate - F_flds(4,:) = (/'Faxa_swnet','Faxa_swnet'/) ! inst_net_sw_flx - F_flds(5,:) = (/'Faxa_lwnet','Faxa_lwnet'/) ! inst_net_lw_flx - F_flds(6,:) = (/'Faxa_sen ','Faxa_sen '/) ! inst_sensi_heat_flx - F_flds(7,:) = (/'Faxa_lat ','Faxa_lat '/) ! inst_laten_heat_flx - do n = 1,size(F_flds,1) - fldname1 = trim(F_flds(n,1)) - fldname2 = trim(F_flds(n,2)) - call addfld_from(compatm, trim(fldname1)) - call addfld_to(compocn, trim(fldname2)) - end do - deallocate(F_flds) - else - allocate(F_flds(10,2)) - F_flds(1 ,:) = (/'Faxa_taux ','Foxx_taux '/) ! inst_zonal_moment_flx_atm - F_flds(2 ,:) = (/'Faxa_tauy ','Foxx_tauy '/) ! inst_merid_moment_flx_atm - F_flds(3 ,:) = (/'Faxa_rain ','Faxa_rain '/) ! inst_prec_rate - F_flds(4 ,:) = (/'Faxa_lwnet ','Foxx_lwnet '/) ! inst_net_lw_flx - F_flds(5 ,:) = (/'Faxa_sen ','Foxx_sen '/) ! inst_sensi_heat_flx - F_flds(6 ,:) = (/'Faxa_evap ','Foxx_evap '/) ! inst_evap_rate - F_flds(7 ,:) = (/'Faxa_swndr ','Foxx_swnet_idr'/) ! inst_down_sw_ir_dir_flx - F_flds(8 ,:) = (/'Faxa_swndf ','Foxx_swnet_idf'/) ! inst_down_sw_ir_dif_flx - F_flds(9 ,:) = (/'Faxa_swvdr ','Foxx_swnet_vdr'/) ! inst_down_sw_vis_dir_flx - F_flds(10,:) = (/'Faxa_swvdf ','Foxx_swnet_vdf'/) ! inst_down_sw_vis_dif_flx - do n = 1,size(F_flds,1) - fldname1 = trim(F_flds(n,1)) - fldname2 = trim(F_flds(n,2)) - call addfld_from(compatm, trim(fldname1)) - call addfld_to(compocn, trim(fldname2)) - end do - deallocate(F_flds) - end if + allocate(F_flds(10,2)) + F_flds(1 ,:) = (/'Faxa_taux ','Foxx_taux '/) ! inst_zonal_moment_flx_atm + F_flds(2 ,:) = (/'Faxa_tauy ','Foxx_tauy '/) ! inst_merid_moment_flx_atm + F_flds(3 ,:) = (/'Faxa_rain ','Faxa_rain '/) ! inst_prec_rate + F_flds(4 ,:) = (/'Faxa_lwnet ','Foxx_lwnet '/) ! inst_net_lw_flx + F_flds(5 ,:) = (/'Faxa_sen ','Foxx_sen '/) ! inst_sensi_heat_flx + F_flds(6 ,:) = (/'Faxa_evap ','Foxx_evap '/) ! inst_evap_rate + F_flds(7 ,:) = (/'Faxa_swndr ','Foxx_swnet_idr'/) ! inst_down_sw_ir_dir_flx + F_flds(8 ,:) = (/'Faxa_swndf ','Foxx_swnet_idf'/) ! inst_down_sw_ir_dif_flx + F_flds(9 ,:) = (/'Faxa_swvdr ','Foxx_swnet_vdr'/) ! inst_down_sw_vis_dir_flx + F_flds(10,:) = (/'Faxa_swvdf ','Foxx_swnet_vdf'/) ! inst_down_sw_vis_dif_flx + do n = 1,size(F_flds,1) + fldname1 = trim(F_flds(n,1)) + fldname2 = trim(F_flds(n,2)) + call addfld_from(compatm, trim(fldname1)) + call addfld_to(compocn, trim(fldname2)) + end do + deallocate(F_flds) end if ! to ocn: partitioned stokes drift from wav if (hafs_attr%wav_present .and. hafs_attr%ocn_present) then - allocate(S_flds(2)) - S_flds = (/'Sw_pstokes_x', 'Sw_pstokes_y'/) - do n = 1,size(S_flds) - fldname = trim(S_flds(n)) - call addfld_from(compwav , fldname) - call addfld_to(compocn , fldname) - end do - deallocate(S_flds) + allocate(S_flds(2)) + S_flds = (/'Sw_pstokes_x', 'Sw_pstokes_y'/) + do n = 1,size(S_flds) + fldname = trim(S_flds(n)) + call addfld_from(compwav , fldname) + call addfld_to(compocn , fldname) + end do + deallocate(S_flds) end if !===================================================================== @@ -359,11 +313,11 @@ subroutine esmFldsExchange_hafs_fchk(gcomp, phase, rc) if (fldchk(is_local%wrap%FBImp(compocn,compocn),'So_omask',rc=rc)) then call ESMF_LogWrite(trim(subname)//": Field connected "//"So_omask", & - ESMF_LOGMSG_INFO) + ESMF_LOGMSG_INFO) else call ESMF_LogSetError(ESMF_FAILURE, & - msg=trim(subname)//": Field is not connected "//"So_omask", & - line=__LINE__, file=__FILE__, rcToReturn=rc) + msg=trim(subname)//": Field is not connected "//"So_omask", & + line=__LINE__, file=__FILE__, rcToReturn=rc) return ! bail out endif @@ -442,39 +396,22 @@ subroutine esmFldsExchange_hafs_init(gcomp, phase, rc) ! to atm: sea surface temperature ! --------------------------------------------------------------------- if (hafs_attr%atm_present .and. hafs_attr%ocn_present) then - if (trim(coupling_mode) == 'hafs') then - allocate(S_flds(1)) - S_flds = (/'So_t'/) ! sea_surface_temperature - do n = 1,size(S_flds) - fldname = trim(S_flds(n)) - if (fldchk(is_local%wrap%FBExp(compatm),trim(fldname),rc=rc) .and. & - fldchk(is_local%wrap%FBImp(compocn,compocn),trim(fldname),rc=rc) & - ) then - call addmap_from(compocn, trim(fldname), compatm, & - mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%ocn2atm_smap) - call addmrg_to(compatm, trim(fldname), & - mrg_from=compocn, mrg_fld=trim(fldname), mrg_type='copy') - end if - end do - deallocate(S_flds) - else - allocate(S_flds(3)) - S_flds = (/'So_t', & ! sea_surface_temperature - 'So_u', & ! surface zonal current - 'So_v'/) ! surface meridional current - do n = 1,size(S_flds) - fldname = trim(S_flds(n)) - if (fldchk(is_local%wrap%FBExp(compatm),trim(fldname),rc=rc) .and. & - fldchk(is_local%wrap%FBImp(compocn,compocn),trim(fldname),rc=rc) & - ) then - call addmap_from(compocn, trim(fldname), compatm, & - mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%ocn2atm_smap) - call addmrg_to(compatm, trim(fldname), & - mrg_from=compocn, mrg_fld=trim(fldname), mrg_type='copy') - end if - end do - deallocate(S_flds) - end if + allocate(S_flds(3)) + S_flds = (/'So_t', & ! sea_surface_temperature + 'So_u', & ! surface zonal current + 'So_v'/) ! surface meridional current + do n = 1,size(S_flds) + fldname = trim(S_flds(n)) + if (fldchk(is_local%wrap%FBExp(compatm),trim(fldname),rc=rc) .and. & + fldchk(is_local%wrap%FBImp(compocn,compocn),trim(fldname),rc=rc) & + ) then + call addmap_from(compocn, trim(fldname), compatm, & + mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%ocn2atm_smap) + call addmrg_to(compatm, trim(fldname), & + mrg_from=compocn, mrg_fld=trim(fldname), mrg_type='copy') + end if + end do + deallocate(S_flds) end if ! --------------------------------------------------------------------- @@ -486,8 +423,8 @@ subroutine esmFldsExchange_hafs_init(gcomp, phase, rc) do n = 1,size(S_flds) fldname = trim(S_flds(n)) if (fldchk(is_local%wrap%FBExp(compatm),trim(fldname),rc=rc) .and. & - fldchk(is_local%wrap%FBImp(compwav,compwav),trim(fldname),rc=rc) & - ) then + fldchk(is_local%wrap%FBImp(compwav,compwav),trim(fldname),rc=rc) & + ) then call addmap_from(compwav, trim(fldname), compatm, & mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%wav2atm_smap) call addmrg_to(compatm, trim(fldname), & @@ -505,96 +442,50 @@ subroutine esmFldsExchange_hafs_init(gcomp, phase, rc) ! to ocn: state fields ! --------------------------------------------------------------------- if (hafs_attr%atm_present .and. hafs_attr%ocn_present) then - if (trim(coupling_mode) == 'hafs') then - allocate(S_flds(6)) - S_flds = (/'Sa_u10m', & ! inst_zonal_wind_height10m - 'Sa_v10m', & ! inst_merid_wind_height10m - 'Sa_t2m ', & ! inst_temp_height2m - 'Sa_q2m ', & ! inst_spec_humid_height2m - 'Sa_pslv', & ! inst_pres_height_surface - 'Sa_tskn' /) ! inst_temp_height_surface - do n = 1,size(S_flds) - fldname = trim(S_flds(n)) - if (fldchk(is_local%wrap%FBExp(compocn),trim(fldname),rc=rc) .and. & - fldchk(is_local%wrap%FBImp(compatm,compatm),trim(fldname),rc=rc) & - ) then - call addmap_from(compatm, trim(fldname), compocn, & - mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%atm2ocn_smap) - call addmrg_to(compocn, trim(fldname), & - mrg_from=compatm, mrg_fld=trim(fldname), mrg_type='copy') - end if - end do - deallocate(S_flds) - else - allocate(S_flds(1)) - S_flds = (/'Sa_pslv'/) ! inst_pres_height_surface - do n = 1,size(S_flds) - fldname = trim(S_flds(n)) - if (fldchk(is_local%wrap%FBExp(compocn),trim(fldname),rc=rc) .and. & - fldchk(is_local%wrap%FBImp(compatm,compatm),trim(fldname),rc=rc) & - ) then - call addmap_from(compatm, trim(fldname), compocn, & - mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%atm2ocn_smap) - call addmrg_to(compocn, trim(fldname), & - mrg_from=compatm, mrg_fld=trim(fldname), mrg_type='copy') - end if - end do - deallocate(S_flds) - end if + allocate(S_flds(1)) + S_flds = (/'Sa_pslv'/) ! inst_pres_height_surface + do n = 1,size(S_flds) + fldname = trim(S_flds(n)) + if (fldchk(is_local%wrap%FBExp(compocn),trim(fldname),rc=rc) .and. & + fldchk(is_local%wrap%FBImp(compatm,compatm),trim(fldname),rc=rc) & + ) then + call addmap_from(compatm, trim(fldname), compocn, & + mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%atm2ocn_smap) + call addmrg_to(compocn, trim(fldname), & + mrg_from=compatm, mrg_fld=trim(fldname), mrg_type='copy') + end if + end do + deallocate(S_flds) end if ! --------------------------------------------------------------------- ! to ocn: flux fields ! --------------------------------------------------------------------- if (hafs_attr%atm_present .and. hafs_attr%ocn_present) then - if (trim(coupling_mode) == 'hafs') then - allocate(F_flds(7,2)) - F_flds(1,:) = (/'Faxa_taux ','Faxa_taux '/) ! inst_zonal_moment_flx_atm - F_flds(2,:) = (/'Faxa_tauy ','Faxa_tauy '/) ! inst_merid_moment_flx_atm - F_flds(3,:) = (/'Faxa_rain ','Faxa_rain '/) ! inst_prec_rate - F_flds(4,:) = (/'Faxa_swnet','Faxa_swnet'/) ! inst_net_sw_flx - F_flds(5,:) = (/'Faxa_lwnet','Faxa_lwnet'/) ! inst_net_lw_flx - F_flds(6,:) = (/'Faxa_sen ','Faxa_sen '/) ! inst_sensi_heat_flx - F_flds(7,:) = (/'Faxa_lat ','Faxa_lat '/) ! inst_laten_heat_flx - do n = 1,size(F_flds,1) - fldname1 = trim(F_flds(n,1)) - fldname2 = trim(F_flds(n,2)) - if (fldchk(is_local%wrap%FBExp(compocn),trim(fldname2),rc=rc) .and. & - fldchk(is_local%wrap%FBImp(compatm,compatm),trim(fldname1),rc=rc) & - ) then - call addmap_from(compatm, trim(fldname1), compocn, & - mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%atm2ocn_smap) - call addmrg_to(compocn, trim(fldname2), & - mrg_from=compatm, mrg_fld=trim(fldname1), mrg_type='copy') - end if - end do - deallocate(F_flds) - else - allocate(F_flds(10,2)) - F_flds(1 ,:) = (/'Faxa_taux ','Foxx_taux '/) ! inst_zonal_moment_flx_atm - F_flds(2 ,:) = (/'Faxa_tauy ','Foxx_tauy '/) ! inst_merid_moment_flx_atm - F_flds(3 ,:) = (/'Faxa_rain ','Faxa_rain '/) ! inst_prec_rate - F_flds(4 ,:) = (/'Faxa_lwnet ','Foxx_lwnet '/) ! inst_net_lw_flx - F_flds(5 ,:) = (/'Faxa_sen ','Foxx_sen '/) ! inst_sensi_heat_flx - F_flds(6 ,:) = (/'Faxa_evap ','Foxx_evap '/) ! inst_evap_rate - F_flds(7 ,:) = (/'Faxa_swndr ','Foxx_swnet_idr'/) ! inst_down_sw_ir_dir_flx - F_flds(8 ,:) = (/'Faxa_swndf ','Foxx_swnet_idf'/) ! inst_down_sw_ir_dif_flx - F_flds(9 ,:) = (/'Faxa_swvdr ','Foxx_swnet_vdr'/) ! inst_down_sw_vis_dir_flx - F_flds(10,:) = (/'Faxa_swvdf ','Foxx_swnet_vdf'/) ! inst_down_sw_vis_dif_flx - do n = 1,size(F_flds,1) - fldname1 = trim(F_flds(n,1)) - fldname2 = trim(F_flds(n,2)) - if (fldchk(is_local%wrap%FBExp(compocn),trim(fldname2),rc=rc) .and. & - fldchk(is_local%wrap%FBImp(compatm,compatm),trim(fldname1),rc=rc) & + allocate(F_flds(10,2)) + F_flds(1 ,:) = (/'Faxa_taux ','Foxx_taux '/) ! inst_zonal_moment_flx_atm + F_flds(2 ,:) = (/'Faxa_tauy ','Foxx_tauy '/) ! inst_merid_moment_flx_atm + F_flds(3 ,:) = (/'Faxa_rain ','Faxa_rain '/) ! inst_prec_rate + F_flds(4 ,:) = (/'Faxa_lwnet ','Foxx_lwnet '/) ! inst_net_lw_flx + F_flds(5 ,:) = (/'Faxa_sen ','Foxx_sen '/) ! inst_sensi_heat_flx + F_flds(6 ,:) = (/'Faxa_evap ','Foxx_evap '/) ! inst_evap_rate + F_flds(7 ,:) = (/'Faxa_swndr ','Foxx_swnet_idr'/) ! inst_down_sw_ir_dir_flx + F_flds(8 ,:) = (/'Faxa_swndf ','Foxx_swnet_idf'/) ! inst_down_sw_ir_dif_flx + F_flds(9 ,:) = (/'Faxa_swvdr ','Foxx_swnet_vdr'/) ! inst_down_sw_vis_dir_flx + F_flds(10,:) = (/'Faxa_swvdf ','Foxx_swnet_vdf'/) ! inst_down_sw_vis_dif_flx + do n = 1,size(F_flds,1) + fldname1 = trim(F_flds(n,1)) + fldname2 = trim(F_flds(n,2)) + if (fldchk(is_local%wrap%FBExp(compocn),trim(fldname2),rc=rc) .and. & + fldchk(is_local%wrap%FBImp(compatm,compatm),trim(fldname1),rc=rc) & ) then - call addmap_from(compatm, trim(fldname1), compocn, & - mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%atm2ocn_smap) - call addmrg_to(compocn, trim(fldname2), & - mrg_from=compatm, mrg_fld=trim(fldname1), mrg_type='copy') - end if - end do - deallocate(F_flds) - end if + call addmap_from(compatm, trim(fldname1), compocn, & + mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%atm2ocn_smap) + call addmrg_to(compocn, trim(fldname2), & + mrg_from=compatm, mrg_fld=trim(fldname1), mrg_type='copy') + end if + end do + deallocate(F_flds) end if ! --------------------------------------------------------------------- @@ -606,9 +497,9 @@ subroutine esmFldsExchange_hafs_init(gcomp, phase, rc) fldname = trim(S_flds(n)) if ( fldchk(is_local%wrap%FBexp(compocn) , fldname, rc=rc) .and. & fldchk(is_local%wrap%FBImp(compwav,compwav), fldname, rc=rc)) then - call addmap_from(compwav, fldname, compocn, mapfillv_bilnr, & - hafs_attr%mapnorm, 'unset') - call addmrg_to(compocn, fldname, mrg_from=compwav, mrg_fld=fldname, mrg_type='copy') + call addmap_from(compwav, fldname, compocn, mapfillv_bilnr, & + hafs_attr%mapnorm, 'unset') + call addmrg_to(compocn, fldname, mrg_from=compwav, mrg_fld=fldname, mrg_type='copy') end if end do deallocate(S_flds) @@ -621,20 +512,20 @@ subroutine esmFldsExchange_hafs_init(gcomp, phase, rc) ! to wav: 10-m wind components ! --------------------------------------------------------------------- if (hafs_attr%atm_present .and. hafs_attr%wav_present) then - allocate(S_flds(2)) - S_flds = (/'Sa_u10m', 'Sa_v10m'/) - do n = 1,size(S_flds) - fldname = trim(S_flds(n)) - if (fldchk(is_local%wrap%FBexp(compwav), trim(fldname),rc=rc) .and. & - fldchk(is_local%wrap%FBImp(compatm,compatm), trim(fldname),rc=rc) & - ) then - call addmap_from(compatm, trim(fldname), compwav, & - mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%atm2wav_smap) - call addmrg_to(compwav, trim(fldname), & - mrg_from=compatm, mrg_fld=trim(fldname), mrg_type='copy') - end if - end do - deallocate(S_flds) + allocate(S_flds(2)) + S_flds = (/'Sa_u10m', 'Sa_v10m'/) + do n = 1,size(S_flds) + fldname = trim(S_flds(n)) + if (fldchk(is_local%wrap%FBexp(compwav), trim(fldname),rc=rc) .and. & + fldchk(is_local%wrap%FBImp(compatm,compatm), trim(fldname),rc=rc) & + ) then + call addmap_from(compatm, trim(fldname), compwav, & + mapfillv_bilnr, hafs_attr%mapnorm, hafs_attr%atm2wav_smap) + call addmrg_to(compwav, trim(fldname), & + mrg_from=compatm, mrg_fld=trim(fldname), mrg_type='copy') + end if + end do + deallocate(S_flds) end if ! --------------------------------------------------------------------- @@ -681,7 +572,7 @@ subroutine esmFldsExchange_hafs_attr(gcomp, hafs_attr, rc) ! Query component for name, verbosity, and diagnostic values call NUOPC_CompGet(gcomp, name=cname, verbosity=verbosity, & - diagnostic=diagnostic, rc=rc) + diagnostic=diagnostic, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return !---------------------------------------------------------- @@ -689,21 +580,21 @@ subroutine esmFldsExchange_hafs_attr(gcomp, hafs_attr, rc) !---------------------------------------------------------- call NUOPC_CompAttributeGet(gcomp, name='ATM_model', & - value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc) + value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return if (isPresent .and. isSet) then if (trim(cvalue) /= 'satm') hafs_attr%atm_present = .true. end if call NUOPC_CompAttributeGet(gcomp, name='OCN_model', & - value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc) + value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return if (isPresent .and. isSet) then if (trim(cvalue) /= 'socn') hafs_attr%ocn_present = .true. end if call NUOPC_CompAttributeGet(gcomp, name='WAV_model', & - value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc) + value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return if (isPresent .and. isSet) then if (trim(cvalue) /= 'swav') hafs_attr%wav_present = .true. @@ -714,11 +605,11 @@ subroutine esmFldsExchange_hafs_attr(gcomp, hafs_attr, rc) !---------------------------------------------------------- call NUOPC_CompAttributeGet(gcomp, name='normalization', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then call NUOPC_CompAttributeGet(gcomp, name='normalization', & - value=hafs_attr%mapnorm, rc=rc) + value=hafs_attr%mapnorm, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if @@ -728,81 +619,81 @@ subroutine esmFldsExchange_hafs_attr(gcomp, hafs_attr, rc) ! to atm call NUOPC_CompAttributeGet(gcomp, name='ocn2atm_smapname', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then call NUOPC_CompAttributeGet(gcomp, name='ocn2atm_smapname', & - value=hafs_attr%ocn2atm_smap, rc=rc) + value=hafs_attr%ocn2atm_smap, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if call NUOPC_CompAttributeGet(gcomp, name='ocn2atm_fmapname', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then call NUOPC_CompAttributeGet(gcomp, name='ocn2atm_fmapname', & - value=hafs_attr%ocn2atm_fmap, rc=rc) + value=hafs_attr%ocn2atm_fmap, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if ! to ocn call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_fmapname', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_fmapname', & - value=hafs_attr%atm2ocn_fmap, rc=rc) + value=hafs_attr%atm2ocn_fmap, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_smapname', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then - call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_smapname', & - value=hafs_attr%atm2ocn_smap, rc=rc) + call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_smapname', & + value=hafs_attr%atm2ocn_smap, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_vmapname', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then call NUOPC_CompAttributeGet(gcomp, name='atm2ocn_vmapname', & - value=hafs_attr%atm2ocn_vmap, rc=rc) + value=hafs_attr%atm2ocn_vmap, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if ! to wav call NUOPC_CompAttributeGet(gcomp, name='atm2wav_smapname', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then call NUOPC_CompAttributeGet(gcomp, name='atm2wav_smapname', & - value=hafs_attr%atm2wav_smap, rc=rc) + value=hafs_attr%atm2wav_smap, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if call NUOPC_CompAttributeGet(gcomp, name='ocn2wav_smapname', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then call NUOPC_CompAttributeGet(gcomp, name='ocn2wav_smapname', & - value=hafs_attr%ocn2wav_smap, rc=rc) + value=hafs_attr%ocn2wav_smap, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if ! from wav call NUOPC_CompAttributeGet(gcomp, name='wav2atm_smapname', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then call NUOPC_CompAttributeGet(gcomp, name='wav2atm_smapname', & - value=hafs_attr%wav2atm_smap, rc=rc) + value=hafs_attr%wav2atm_smap, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if call NUOPC_CompAttributeGet(gcomp, name='wav2ocn_smapname', & - isPresent=isPresent, rc=rc) + isPresent=isPresent, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return if (isPresent) then call NUOPC_CompAttributeGet(gcomp, name='wav2ocn_smapname', & - value=hafs_attr%wav2ocn_smap, rc=rc) + value=hafs_attr%wav2ocn_smap, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return end if @@ -810,22 +701,22 @@ subroutine esmFldsExchange_hafs_attr(gcomp, hafs_attr, rc) if (btest(verbosity,16)) then write(cvalue,"(I0)") verbosity call ESMF_LogWrite(trim(subname)//': Verbosity = '// & - trim(cvalue), ESMF_LOGMSG_INFO) + trim(cvalue), ESMF_LOGMSG_INFO) write(cvalue,"(I0)") diagnostic call ESMF_LogWrite(trim(subname)//': Diagnostic = '// & - trim(cvalue), ESMF_LOGMSG_INFO) + trim(cvalue), ESMF_LOGMSG_INFO) call ESMF_LogWrite(trim(subname)//': normalization = '// & - trim(hafs_attr%mapnorm), ESMF_LOGMSG_INFO) + trim(hafs_attr%mapnorm), ESMF_LOGMSG_INFO) call ESMF_LogWrite(trim(subname)//': ocn2atm_smapname = '// & - trim(hafs_attr%ocn2atm_smap), ESMF_LOGMSG_INFO) + trim(hafs_attr%ocn2atm_smap), ESMF_LOGMSG_INFO) call ESMF_LogWrite(trim(subname)//': ocn2atm_fmapname = '// & - trim(hafs_attr%ocn2atm_fmap), ESMF_LOGMSG_INFO) + trim(hafs_attr%ocn2atm_fmap), ESMF_LOGMSG_INFO) call ESMF_LogWrite(trim(subname)//': atm2ocn_fmapname = '// & - trim(hafs_attr%atm2ocn_fmap), ESMF_LOGMSG_INFO) + trim(hafs_attr%atm2ocn_fmap), ESMF_LOGMSG_INFO) call ESMF_LogWrite(trim(subname)//': atm2ocn_smapname = '// & - trim(hafs_attr%atm2ocn_smap), ESMF_LOGMSG_INFO) + trim(hafs_attr%atm2ocn_smap), ESMF_LOGMSG_INFO) call ESMF_LogWrite(trim(subname)//': atm2ocn_vmapname = '// & - trim(hafs_attr%atm2ocn_vmap), ESMF_LOGMSG_INFO) + trim(hafs_attr%atm2ocn_vmap), ESMF_LOGMSG_INFO) endif call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO) diff --git a/mediator/esmFldsExchange_ufs_mod.F90 b/mediator/esmFldsExchange_ufs_mod.F90 index dd342cf07..919ec34ff 100644 --- a/mediator/esmFldsExchange_ufs_mod.F90 +++ b/mediator/esmFldsExchange_ufs_mod.F90 @@ -6,6 +6,11 @@ module esmFldsExchange_ufs_mod ! mapping and merging !--------------------------------------------------------------------- + use ESMF + use NUOPC + use med_utils_mod , only : chkerr => med_utils_chkerr + use med_kind_mod , only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, R8=>SHR_KIND_R8 + implicit none public @@ -14,6 +19,14 @@ module esmFldsExchange_ufs_mod integer :: atm2lnd_maptype integer :: lnd2atm_maptype + ! optional mapping files + character(len=CL) :: a2oi_bilnr + character(len=CL) :: a2oi_patch + character(len=CL) :: a2oi_consf + character(len=CL) :: a2w_bilnr + character(len=CL) :: w2oi_bilnr_nstod + character(len=CL) :: oi2w_bilnr_nstod + character(*), parameter :: u_FILE_u = & __FILE__ @@ -23,10 +36,6 @@ module esmFldsExchange_ufs_mod subroutine esmFldsExchange_ufs(gcomp, phase, rc) - use ESMF - use NUOPC - use med_kind_mod , only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, R8=>SHR_KIND_R8 - use med_utils_mod , only : chkerr => med_utils_chkerr use med_methods_mod , only : fldchk => med_methods_FB_FldChk use med_internalstate_mod , only : InternalState use med_internalstate_mod , only : compmed, compatm, compocn, compice, complnd, compwav, ncomps @@ -76,7 +85,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) if (chkerr(rc,__LINE__,u_FILE_u)) return ! Set maptype according to coupling_mode - if (trim(coupling_mode) == 'ufs.nfrac' .or. trim(coupling_mode) == 'ufs.nfrac.aoflux') then + if (trim(coupling_mode) == 'ufs.nfrac') then maptype = mapnstod_consf else maptype = mapconsf @@ -101,6 +110,22 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) end if end if + ! to ocn/ice + a2oi_bilnr = get_mapfile(gcomp, 'map_a2oi_bilnr', rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + a2oi_patch = get_mapfile(gcomp, 'map_a2oi_patch', rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + a2oi_consf = get_mapfile(gcomp, 'map_a2oi_consf', rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + w2oi_bilnr_nstod = get_mapfile(gcomp, 'map_w2oi_bilnr_nstod', rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + + ! to wav + a2w_bilnr = get_mapfile(gcomp, 'map_a2w_bilnr', rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + oi2w_bilnr_nstod = get_mapfile(gcomp, 'map_oi2w_bilnr_nstod', rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + if (trim(coupling_mode) == 'ufs.nfrac.aoflux' .or. trim(coupling_mode) == 'ufs.frac.aoflux') then med_aoflux_to_ocn = .true. else @@ -159,7 +184,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) call addfld_from(compatm , fldname) else if ( fldchk(is_local%wrap%FBImp(compatm,compatm), fldname, rc=rc)) then - call addmap_from(compatm, fldname, compocn, mapbilnr, 'one', 'unset') + call addmap_from(compatm, fldname, compocn, mapbilnr, 'one', a2oi_bilnr) end if end if end do @@ -256,19 +281,25 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) end do deallocate(flds) - ! to atm: unmerged surface temperatures from ocn - if (phase == 'advertise') then - if (is_local%wrap%comp_present(compocn) .and. is_local%wrap%comp_present(compatm)) then - call addfld_from(compocn , 'So_t') - call addfld_to(compatm , 'So_t') - end if - else - if ( fldchk(is_local%wrap%FBexp(compatm) , 'So_t', rc=rc) .and. & - fldchk(is_local%wrap%FBImp(compocn,compocn), 'So_t', rc=rc)) then - call addmap_from(compocn, 'So_t', compatm, maptype, 'ofrac', 'unset') - call addmrg_to(compatm, 'So_t', mrg_from=compocn, mrg_fld='So_t', mrg_type='copy') + ! to atm: unmerged surface temperatures and currents from ocn + allocate(flds(3)) + flds = (/'So_t', 'So_u', 'So_v'/) + do n = 1,size(flds) + fldname = trim(flds(n)) + if (phase == 'advertise') then + if (is_local%wrap%comp_present(compocn) .and. is_local%wrap%comp_present(compatm)) then + call addfld_from(compocn , fldname) + call addfld_to(compatm , fldname) + end if + else + if ( fldchk(is_local%wrap%FBexp(compatm) , fldname, rc=rc) .and. & + fldchk(is_local%wrap%FBImp(compocn,compocn), fldname, rc=rc)) then + call addmap_from(compocn, fldname, compatm, maptype, 'ofrac', 'unset') + call addmrg_to(compatm, fldname, mrg_from=compocn, mrg_fld=fldname, mrg_type='copy') + end if end if - end if + end do + deallocate(flds) ! to atm: unmerged flux components from lnd if (is_local%wrap%comp_present(complnd) .and. is_local%wrap%comp_present(compatm)) then @@ -312,7 +343,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) deallocate(flds) end if - ! to atm: unmerged from mediator, merge will be done under FV3/CCPP composite step + ! to atm: unmerged from mediator, merge will be done under UFSATM/CCPP composite step ! - zonal surface stress, meridional surface stress ! - surface latent heat flux, ! - surface sensible heat flux @@ -364,7 +395,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compocn) , 'Sa_pslv', rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm), 'Sa_pslv', rc=rc)) then - call addmap_from(compatm, 'Sa_pslv', compocn, maptype, 'one', 'unset') + call addmap_from(compatm, 'Sa_pslv', compocn, mapbilnr, 'one', a2oi_bilnr) call addmrg_to(compocn, 'Sa_pslv', mrg_from=compatm, mrg_fld='Sa_pslv', mrg_type='copy') end if end if @@ -399,7 +430,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compocn) , trim(oflds(n)), rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm), trim(aflds(n)), rc=rc)) then - call addmap_from(compatm, trim(aflds(n)), compocn, maptype, 'one', 'unset') + call addmap_from(compatm, trim(aflds(n)), compocn, maptype, 'one', a2oi_consf) end if end if end do @@ -434,7 +465,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compocn) , fldname, rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm), fldname, rc=rc)) then - call addmap_from(compatm, fldname, compocn, maptype, 'one', 'unset') + call addmap_from(compatm, fldname, compocn, maptype, 'one', a2oi_consf) call addmrg_to(compocn, fldname, & mrg_from=compatm, mrg_fld=fldname, mrg_type='copy_with_weights', mrg_fracname='ofrac') end if @@ -469,9 +500,9 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) fldchk(is_local%wrap%FBImp(compatm,compatm), 'Faxa_'//fldname, rc=rc)) then call addmap_from(compice, 'Fioi_'//fldname, compocn, mapfcopy, 'unset', 'unset') if (mapuv_with_cart3d) then - call addmap_from(compatm, 'Faxa_'//fldname, compocn, mapconsf_uv3d, 'aofrac', 'unset') + call addmap_from(compatm, 'Faxa_'//fldname, compocn, mapconsf_uv3d, 'aofrac', a2oi_consf) else - call addmap_from(compatm, 'Faxa_'//fldname, compocn, mapconsf_aofrac, 'aofrac', 'unset') + call addmap_from(compatm, 'Faxa_'//fldname, compocn, mapconsf_aofrac, 'aofrac', a2oi_consf) end if call addmrg_to(compocn, 'Foxx_'//fldname, & mrg_from=compice, mrg_fld='Fioi_'//fldname, mrg_type='merge', mrg_fracname='ifrac') @@ -505,7 +536,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compocn) , 'Foxx_lwnet', rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm), 'Faxa_lwnet', rc=rc)) then - call addmap_from(compatm, 'Faxa_lwnet', compocn, mapconsf_aofrac, 'aofrac', 'unset') + call addmap_from(compatm, 'Faxa_lwnet', compocn, mapconsf_aofrac, 'aofrac', a2oi_consf) call addmrg_to(compocn, 'Foxx_lwnet', & mrg_from=compatm, mrg_fld='Faxa_lwnet', mrg_type='copy_with_weights', mrg_fracname='ofrac') end if @@ -529,7 +560,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compocn) , 'Foxx_sen', rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm), 'Faxa_sen', rc=rc)) then - call addmap_from(compatm, 'Faxa_sen', compocn, mapconsf_aofrac, 'aofrac', 'unset') + call addmap_from(compatm, 'Faxa_sen', compocn, mapconsf_aofrac, 'aofrac', a2oi_consf) call addmrg_to(compocn, 'Foxx_sen', & mrg_from=compatm, mrg_fld='Faxa_sen', mrg_type='copy_with_weights', mrg_fracname='ofrac') end if @@ -553,7 +584,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compocn) , 'Foxx_evap', rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm), 'Faxa_evap' , rc=rc)) then - call addmap_from(compatm, 'Faxa_evap', compocn, mapconsf_aofrac, 'aofrac', 'unset') + call addmap_from(compatm, 'Faxa_evap', compocn, mapconsf_aofrac, 'aofrac', a2oi_consf) call addmrg_to(compocn, 'Foxx_evap', & mrg_from=compatm, mrg_fld='Faxa_evap', mrg_type='copy_with_weights', mrg_fracname='ofrac') end if @@ -597,7 +628,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compocn) , fldname, rc=rc) .and. & fldchk(is_local%wrap%FBImp(compwav,compwav), fldname, rc=rc)) then - call addmap_from(compwav, fldname, compocn, mapbilnr_nstod, 'one', 'unset') + call addmap_from(compwav, fldname, compocn, mapbilnr_nstod, 'one', w2oi_bilnr_nstod) call addmrg_to(compocn, fldname, mrg_from=compwav, mrg_fld=fldname, mrg_type='copy') end if end if @@ -630,7 +661,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compice) , fldname, rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm), fldname, rc=rc)) then - call addmap_from(compatm, fldname, compice, maptype, 'one', 'unset') + call addmap_from(compatm, fldname, compice, maptype, 'one', a2oi_consf) call addmrg_to(compice, fldname, mrg_from=compatm, mrg_fld=fldname, mrg_type='copy') end if end if @@ -656,7 +687,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compice) , fldname, rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm), fldname, rc=rc)) then - call addmap_from(compatm, fldname, compice, mapbilnr, 'one', 'unset') + call addmap_from(compatm, fldname, compice, mapbilnr, 'one', a2oi_bilnr) call addmrg_to(compice, fldname, mrg_from=compatm, mrg_fld=fldname, mrg_type='copy') end if end if @@ -676,9 +707,9 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) if ( fldchk(is_local%wrap%FBexp(compice) , fldname, rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm), fldname, rc=rc)) then if (mapuv_with_cart3d) then - call addmap_from(compatm, fldname, compice, mappatch_uv3d, 'one', 'unset') + call addmap_from(compatm, fldname, compice, mappatch_uv3d, 'one', a2oi_patch) else - call addmap_from(compatm, fldname, compice, mappatch, 'one', 'unset') + call addmap_from(compatm, fldname, compice, mappatch, 'one', a2oi_patch) end if call addmrg_to(compice, fldname, mrg_from=compatm, mrg_fld=fldname, mrg_type='copy') end if @@ -722,7 +753,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBExp(compice) , 'Sw_elevation_spectrum', rc=rc) .and. & fldchk(is_local%wrap%FBImp(compwav,compwav), 'Sw_elevation_spectrum', rc=rc)) then - call addmap_from(compwav, 'Sw_elevation_spectrum', compice, mapbilnr_nstod, 'one', 'unset') + call addmap_from(compwav, 'Sw_elevation_spectrum', compice, mapbilnr_nstod, 'one', w2oi_bilnr_nstod) call addmrg_to(compice, 'Sw_elevation_spectrum', mrg_from=compwav, & mrg_fld='Sw_elevation_spectrum', mrg_type='copy') end if @@ -747,7 +778,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compwav) , fldname, rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm), fldname, rc=rc)) then - call addmap_from(compatm, fldname, compwav, mapbilnr, 'one', 'unset') + call addmap_from(compatm, fldname, compwav, mapbilnr, 'one', a2w_bilnr) call addmrg_to(compwav, fldname, mrg_from=compatm, mrg_fld=fldname, mrg_type='copy') end if end if @@ -770,7 +801,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compwav) , fldname, rc=rc) .and. & fldchk(is_local%wrap%FBImp(compice,compice), fldname, rc=rc)) then - call addmap_from(compice, fldname, compwav, mapbilnr_nstod , 'one', 'unset') + call addmap_from(compice, fldname, compwav, mapbilnr_nstod , 'one', oi2w_bilnr_nstod) call addmrg_to(compwav, fldname, mrg_from=compice, mrg_fld=fldname, mrg_type='copy') end if end if @@ -793,7 +824,7 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) else if ( fldchk(is_local%wrap%FBexp(compwav) , fldname, rc=rc) .and. & fldchk(is_local%wrap%FBImp(compocn,compocn), fldname, rc=rc)) then - call addmap_from(compocn, fldname, compwav, mapbilnr_nstod , 'one', 'unset') + call addmap_from(compocn, fldname, compwav, mapbilnr_nstod , 'one', oi2w_bilnr_nstod) call addmrg_to(compwav, fldname, mrg_from=compocn, mrg_fld=fldname, mrg_type='copy') end if end if @@ -860,4 +891,28 @@ subroutine esmFldsExchange_ufs(gcomp, phase, rc) end subroutine esmFldsExchange_ufs + function get_mapfile(gcomp, attribute_name, rc) result(mapfile) + + type(ESMF_GridComp), intent(in) :: gcomp + character(len=*) , intent(in) :: attribute_name + integer , intent(inout) :: rc + character(len=CL) :: mapfile + + logical :: isPresent, isSet + character(len=CL) :: cvalue + !-------------------------------------- + + rc = ESMF_SUCCESS + + mapfile = 'unset' + call NUOPC_CompAttributeGet(gcomp, name=attribute_name, isPresent=isPresent, isSet=isSet, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + if (isPresent .and. isSet) then + call NUOPC_CompAttributeGet(gcomp, name=attribute_name, value=cvalue, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + mapfile = trim(cvalue) + end if + + end function get_mapfile + end module esmFldsExchange_ufs_mod diff --git a/mediator/med.F90 b/mediator/med.F90 index 50a24b083..445159ece 100644 --- a/mediator/med.F90 +++ b/mediator/med.F90 @@ -54,6 +54,8 @@ module MED use esmFldsExchange_hafs_mod , only : esmFldsExchange_hafs use med_phases_profile_mod , only : med_phases_profile_finalize use shr_log_mod , only : shr_log_error + use med_ufs_trace_wrapper_mod, only : ufs_trace_init_wrapper, ufs_trace_wrapper, ufs_trace_finalize_wrapper + implicit none @@ -89,6 +91,7 @@ subroutine SetServices(gcomp, rc) use ESMF , only: ESMF_SUCCESS, ESMF_GridCompSetEntryPoint use ESMF , only: ESMF_METHOD_INITIALIZE, ESMF_METHOD_RUN use ESMF , only: ESMF_GridComp, ESMF_MethodRemove + use ESMF , only: ESMF_VM, ESMF_VMGet, ESMF_GridCompGet use NUOPC , only: NUOPC_CompDerive, NUOPC_CompSetEntryPoint, NUOPC_CompSpecialize, NUOPC_NoOP use NUOPC_Mediator , only: mediator_routine_SS => SetServices use NUOPC_Mediator , only: mediator_routine_Run => routine_Run @@ -135,6 +138,8 @@ subroutine SetServices(gcomp, rc) type(ESMF_GridComp) :: gcomp integer, intent(out) :: rc + type(ESMF_VM) :: vm + integer :: localPet ! local variables character(len=*), parameter :: subname = '('//__FILE__//':SetServices)' !----------------------------------------------------------- @@ -142,6 +147,15 @@ subroutine SetServices(gcomp, rc) rc = ESMF_SUCCESS if (profile_memory) call ESMF_VMLogMemInfo("Entering "//trim(subname)) + call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + call ESMF_VMGet(vm, localPet=localPet, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + maintask = .false. + if (localPet == 0) maintask=.true. + if (maintask) call ufs_trace_init_wrapper() + if (maintask) call ufs_trace_wrapper("cmeps", "SetServices", "B") + !------------------ ! the NUOPC model component mediator_routine_SS will register the generic methods !------------------ @@ -557,6 +571,7 @@ subroutine SetServices(gcomp, rc) if (profile_memory) call ESMF_VMLogMemInfo("Leaving "//trim(subname)) + if (maintask) call ufs_trace_wrapper("cmeps", "SetServices", "E") end subroutine SetServices !----------------------------------------------------------------------------- @@ -594,6 +609,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO) if (profile_memory) call ESMF_VMLogMemInfo("Entering "//trim(subname)) + if (maintask) call ufs_trace_wrapper("cmeps", "InitializeP0", "B") call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return call ESMF_VMGet(vm, localPet=localPet, rc=rc) @@ -664,6 +680,8 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) if (profile_memory) call ESMF_VMLogMemInfo("Leaving "//trim(subname)) call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO) + if (maintask) call ufs_trace_wrapper("cmeps", "InitializeP0", "E") + end subroutine InitializeP0 !----------------------------------------------------------------------- @@ -703,6 +721,7 @@ subroutine AdvertiseFields(gcomp, importState, exportState, clock, rc) character(len=*), parameter :: subname = '('//__FILE__//':AdvertiseFields)' !----------------------------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "AdvertiseFields", "B") call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO) rc = ESMF_SUCCESS if (profile_memory) call ESMF_VMLogMemInfo("Entering "//trim(subname)) @@ -839,7 +858,7 @@ subroutine AdvertiseFields(gcomp, importState, exportState, clock, rc) else if (coupling_mode(1:3) == 'ufs') then call esmFldsExchange_ufs(gcomp, phase='advertise', rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return - else if (coupling_mode(1:4) == 'hafs') then + else if (trim(coupling_mode) == 'hafs') then call esmFldsExchange_hafs(gcomp, phase='advertise', rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return else @@ -995,6 +1014,7 @@ subroutine AdvertiseFields(gcomp, importState, exportState, clock, rc) if (profile_memory) call ESMF_VMLogMemInfo("Leaving "//trim(subname)) call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO) + if (maintask) call ufs_trace_wrapper("cmeps", "AdvertiseFields", "E") end subroutine AdvertiseFields !----------------------------------------------------------------------------- @@ -1021,6 +1041,7 @@ subroutine RealizeFieldsWithTransferProvided(gcomp, importState, exportState, cl integer :: n character(len=*), parameter :: subname = '('//__FILE__//':RealizeFieldsWithTransferProvided)' !----------------------------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "RealizeFieldsWithTransferProvided", "B") call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO) rc = ESMF_SUCCESS @@ -1058,6 +1079,7 @@ subroutine RealizeFieldsWithTransferProvided(gcomp, importState, exportState, cl if (profile_memory) call ESMF_VMLogMemInfo("Leaving "//trim(subname)) call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO) + if (maintask) call ufs_trace_wrapper("cmeps", "RealizeFieldsWithTransferProvided", "E") end subroutine RealizeFieldsWithTransferProvided @@ -1082,6 +1104,7 @@ subroutine ModifyDecompofMesh(gcomp, importState, exportState, clock, rc) integer :: n1 character(len=*), parameter :: subname = '('//__FILE__//':ModifyDecompofMesh)' !----------------------------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "ModifyDecompofMesh", "B") call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO) rc = ESMF_SUCCESS @@ -1110,6 +1133,7 @@ subroutine ModifyDecompofMesh(gcomp, importState, exportState, clock, rc) enddo if (profile_memory) call ESMF_VMLogMemInfo("Leaving "//trim(subname)) call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO) + if (maintask) call ufs_trace_wrapper("cmeps", "ModifyDecompofMesh", "E") contains !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1407,6 +1431,7 @@ subroutine RealizeFieldsWithTransferAccept(gcomp, importState, exportState, cloc integer :: n1 character(len=*), parameter :: subname = '('//__FILE__//':RealizeFieldsWithTransferAccept)' !----------------------------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "RealizeFieldsWithTransferAccept", "B") call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO) @@ -1446,6 +1471,7 @@ subroutine RealizeFieldsWithTransferAccept(gcomp, importState, exportState, cloc if (profile_memory) call ESMF_VMLogMemInfo("Leaving "//trim(subname)) call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO) + if (maintask) call ufs_trace_wrapper("cmeps", "RealizeFieldsWithTransferAccept", "E") contains !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1671,6 +1697,7 @@ subroutine DataInitialize(gcomp, rc) character(len=CX) :: msgString character(len=*), parameter :: subname = '('//__FILE__//':DataInitialize)' !----------------------------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "DataInitialize", "B") call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO) rc = ESMF_SUCCESS @@ -1869,7 +1896,7 @@ subroutine DataInitialize(gcomp, rc) else if (coupling_mode(1:3) == 'ufs') then call esmFldsExchange_ufs(gcomp, phase='initialize', rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return - else if (coupling_mode(1:4) == 'hafs') then + else if (trim(coupling_mode) == 'hafs') then call esmFldsExchange_hafs(gcomp, phase='initialize', rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return end if @@ -1990,6 +2017,7 @@ subroutine DataInitialize(gcomp, rc) ! the correct timestamps, which also indicates that the actual ! data has been transferred reliably, and CMEPS can safely use it. + if (maintask) call ufs_trace_wrapper("cmeps", "DataInitialize", "E") RETURN endif ! end first_call if-block @@ -2281,6 +2309,7 @@ subroutine DataInitialize(gcomp, rc) call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO) endif + if (maintask) call ufs_trace_wrapper("cmeps", "DataInitialize", "E") end subroutine DataInitialize !----------------------------------------------------------------------------- diff --git a/mediator/med_internalstate_mod.F90 b/mediator/med_internalstate_mod.F90 index 70c95ac37..f8412e6f1 100644 --- a/mediator/med_internalstate_mod.F90 +++ b/mediator/med_internalstate_mod.F90 @@ -47,7 +47,7 @@ module med_internalstate_mod character(len=CS), public :: glc_name = '' ! Coupling mode - character(len=CS), public :: coupling_mode ! valid values are [cesm,ufs.nfrac,ufs.frac,ufs.nfrac.aoflux,ufs.frac.aoflux,hafs,hafs.mom6] + character(len=CS), public :: coupling_mode ! valid values are [cesm,ufs.nfrac,ufs.frac,ufs.nfrac.aoflux,ufs.frac.aoflux,hafs] ! Atmosphere-ocean flux algorithm character(len=CS), public :: aoflux_code ! valid values are [cesm,ccpp] @@ -692,9 +692,6 @@ subroutine med_internalstate_defaultmasks(gcomp, rc) if ( coupling_mode(1:3) == 'ufs') then if (is_local%wrap%comp_present(compatm)) defaultMasks(compatm,2) = 1 endif - if ( trim(coupling_mode) == 'hafs') then ! not hafs.mom6 - if (is_local%wrap%comp_present(compatm)) defaultMasks(compatm,1) = 1 - endif if ( coupling_mode /= 'cesm') then if (is_local%wrap%comp_present(compatm) .and. atm_name(1:4) == 'datm') then defaultMasks(compatm,1) = 0 diff --git a/mediator/med_map_mod.F90 b/mediator/med_map_mod.F90 index 2d5374c66..9822dec19 100644 --- a/mediator/med_map_mod.F90 +++ b/mediator/med_map_mod.F90 @@ -431,7 +431,7 @@ subroutine med_map_routehandles_initfrom_field(n1, n2, fldsrc, flddst, mapindex, dstMaskValue = ispval_mask end if end if - if (coupling_mode(1:4) == 'hafs') then + if (trim(coupling_mode) == 'hafs') then if (n1 == compatm .and. n2 == compwav) then srcMaskValue = ispval_mask end if @@ -446,7 +446,7 @@ subroutine med_map_routehandles_initfrom_field(n1, n2, fldsrc, flddst, mapindex, polemethod = ESMF_POLEMETHOD_NONE ! todo: remove this when ESMF tripolar mapping fix is in place. endif end if - if (trim(coupling_mode) == 'hafs.mom6') then + if (trim(coupling_mode) == 'hafs') then polemethod = ESMF_POLEMETHOD_NONE endif diff --git a/mediator/med_phases_aofluxes_mod.F90 b/mediator/med_phases_aofluxes_mod.F90 index 64de18785..103d37ba4 100644 --- a/mediator/med_phases_aofluxes_mod.F90 +++ b/mediator/med_phases_aofluxes_mod.F90 @@ -1600,37 +1600,25 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r lsize = size(aoflux_in%zbot) aoflux_in%lsize = lsize - ! bulk formula quantities for ufs non-frac with med-aoflux - if (trim(coupling_mode) == 'ufs.nfrac.aoflux' .and. ocn_surface_flux_scheme == -1) then - call fldbun_getfldptr(fldbun_a, 'Sa_u10m', aoflux_in%ubot, xgrid=xgrid, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call fldbun_getfldptr(fldbun_a, 'Sa_v10m', aoflux_in%vbot, xgrid=xgrid, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call fldbun_getfldptr(fldbun_a, 'Sa_t2m', aoflux_in%tbot, xgrid=xgrid, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call fldbun_getfldptr(fldbun_a, 'Sa_q2m', aoflux_in%shum, xgrid=xgrid, rc=rc) + call fldbun_getfldptr(fldbun_a, 'Sa_u', aoflux_in%ubot, xgrid=xgrid, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + call fldbun_getfldptr(fldbun_a, 'Sa_v', aoflux_in%vbot, xgrid=xgrid, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + call fldbun_getfldptr(fldbun_a, 'Sa_tbot', aoflux_in%tbot, xgrid=xgrid, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + call fldbun_getfldptr(fldbun_a, 'Sa_shum', aoflux_in%shum, xgrid=xgrid, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + if (add_gusts) then + call fldbun_getfldptr(fldbun_a, 'Faxa_rainc', aoflux_in%rainc, xgrid=xgrid, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return else - call fldbun_getfldptr(fldbun_a, 'Sa_u', aoflux_in%ubot, xgrid=xgrid, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call fldbun_getfldptr(fldbun_a, 'Sa_v', aoflux_in%vbot, xgrid=xgrid, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call fldbun_getfldptr(fldbun_a, 'Sa_tbot', aoflux_in%tbot, xgrid=xgrid, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call fldbun_getfldptr(fldbun_a, 'Sa_shum', aoflux_in%shum, xgrid=xgrid, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - if (add_gusts) then - call fldbun_getfldptr(fldbun_a, 'Faxa_rainc', aoflux_in%rainc, xgrid=xgrid, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - else - ! rainc is not used without add_gusts but some compilers complain about the unallocated pointer - ! in the subroutine interface - allocate(aoflux_in%rainc(1)) - end if + ! rainc is not used without add_gusts but some compilers complain about the unallocated pointer + ! in the subroutine interface + allocate(aoflux_in%rainc(1)) end if - ! extra fields for ufs.frac.aoflux - if (trim(coupling_mode) == 'ufs.frac.aoflux') then + ! extra fields for CCPP aoflux + if (trim(aoflux_code) == 'ccpp') then call fldbun_getfldptr(fldbun_a, 'Sa_u10m', aoflux_in%usfc, xgrid=xgrid, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return call fldbun_getfldptr(fldbun_a, 'Sa_v10m', aoflux_in%vsfc, xgrid=xgrid, rc=rc) diff --git a/mediator/med_phases_history_mod.F90 b/mediator/med_phases_history_mod.F90 index 6da6efafd..772d5c8b5 100644 --- a/mediator/med_phases_history_mod.F90 +++ b/mediator/med_phases_history_mod.F90 @@ -25,6 +25,8 @@ module med_phases_history_mod use perf_mod , only : t_startf, t_stopf use pio , only : file_desc_t use shr_log_mod , only : shr_log_error + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper + implicit none private @@ -189,6 +191,7 @@ subroutine med_phases_history_write(gcomp, rc) !--------------------------------------- rc = ESMF_SUCCESS + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_history_write", "B") call t_startf('MED:'//subname) ! Get the internal state @@ -384,6 +387,7 @@ subroutine med_phases_history_write(gcomp, rc) call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_history_write", "E") end subroutine med_phases_history_write !=============================================================================== @@ -421,6 +425,7 @@ subroutine med_phases_history_write_med(gcomp, rc) character(len=*), parameter :: subname='(med_phases_history_write_med)' !--------------------------------------- rc = ESMF_SUCCESS + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_history_write_med", "B") ! Get the internal state nullify(is_local%wrap) @@ -527,6 +532,7 @@ subroutine med_phases_history_write_med(gcomp, rc) end if ! end of if-write_now block end if ! end of if-active block + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_history_write_med", "E") end subroutine med_phases_history_write_med !=============================================================================== @@ -568,6 +574,7 @@ subroutine med_phases_history_write_lnd2glc(gcomp, fldbun_lnd, rc, fldbun_glc) !--------------------------------------- rc = ESMF_SUCCESS + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_history_write_lnd2glc", "B") ! Get the internal state nullify(is_local%wrap) @@ -656,6 +663,7 @@ subroutine med_phases_history_write_lnd2glc(gcomp, fldbun_lnd, rc, fldbun_glc) call med_io_close(io_file, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_history_write_lnd2glc", "E") end subroutine med_phases_history_write_lnd2glc !=============================================================================== @@ -669,6 +677,7 @@ subroutine med_phases_history_write_comp(gcomp, compid, rc) integer , intent(out) :: rc !--------------------------------------- rc = ESMF_SUCCESS + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_history_write_comp", "B") call med_phases_history_write_comp_inst(gcomp, compid, instfiles(compid), rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -677,6 +686,7 @@ subroutine med_phases_history_write_comp(gcomp, compid, rc) call med_phases_history_write_comp_aux(gcomp, compid, auxcomp(compid), rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_history_write_comp", "E") end subroutine med_phases_history_write_comp !=============================================================================== diff --git a/mediator/med_phases_ocnalb_mod.F90 b/mediator/med_phases_ocnalb_mod.F90 index b7c95389a..5f247192d 100644 --- a/mediator/med_phases_ocnalb_mod.F90 +++ b/mediator/med_phases_ocnalb_mod.F90 @@ -11,6 +11,8 @@ module med_phases_ocnalb_mod use shr_orb_mod , only : shr_orb_cosz, shr_orb_decl use shr_orb_mod , only : shr_orb_params, SHR_ORB_UNDEF_INT, SHR_ORB_UNDEF_REAL use shr_log_mod , only : shr_log_unit, shr_log_error + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper + implicit none private @@ -314,6 +316,7 @@ subroutine med_phases_ocnalb_run(gcomp, rc) !--------------------------------------- rc = ESMF_SUCCESS + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_ocnalb_run", "B") ! Determine main task call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) @@ -507,6 +510,7 @@ subroutine med_phases_ocnalb_run(gcomp, rc) end if call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_ocnalb_run", "E") end subroutine med_phases_ocnalb_run !=============================================================================== diff --git a/mediator/med_phases_post_atm_mod.F90 b/mediator/med_phases_post_atm_mod.F90 index a28d2bec9..353d424fe 100644 --- a/mediator/med_phases_post_atm_mod.F90 +++ b/mediator/med_phases_post_atm_mod.F90 @@ -28,7 +28,7 @@ subroutine med_phases_post_atm(gcomp, rc) use ESMF , only : ESMF_GridComp, ESMF_GridCompGet, ESMF_FieldBundleGet use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS use med_kind_mod , only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, R8=>SHR_KIND_R8 - use med_internalstate_mod , only : InternalState + use med_internalstate_mod , only : InternalState, maintask use med_phases_history_mod, only : med_phases_history_write_comp use med_map_mod , only : med_map_field_packed use med_constants_mod , only : dbug_flag => med_constants_dbug_flag @@ -36,6 +36,7 @@ subroutine med_phases_post_atm(gcomp, rc) use med_methods_mod , only : med_methods_FB_check_wtracers use med_internalstate_mod , only : compocn, compatm, compice, complnd, compwav use perf_mod , only : t_startf, t_stopf + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper ! input/output variables type(ESMF_GridComp) :: gcomp @@ -48,6 +49,7 @@ subroutine med_phases_post_atm(gcomp, rc) !------------------------------------------------------------------------------- rc = ESMF_SUCCESS + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_post_atm", "B") call t_startf('MED:'//subname) if (dbug_flag > 20) then @@ -132,6 +134,7 @@ subroutine med_phases_post_atm(gcomp, rc) end if call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_post_atm", "E") end subroutine med_phases_post_atm end module med_phases_post_atm_mod diff --git a/mediator/med_phases_post_ice_mod.F90 b/mediator/med_phases_post_ice_mod.F90 index 41e92b27e..4c2d1a65c 100644 --- a/mediator/med_phases_post_ice_mod.F90 +++ b/mediator/med_phases_post_ice_mod.F90 @@ -29,10 +29,11 @@ subroutine med_phases_post_ice(gcomp, rc) use med_methods_mod , only : med_methods_FB_check_wtracers use med_map_mod , only : med_map_field_packed use med_fraction_mod , only : med_fraction_set - use med_internalstate_mod , only : InternalState + use med_internalstate_mod , only : InternalState, maintask use med_phases_history_mod, only : med_phases_history_write_comp use med_internalstate_mod , only : compice, compocn, compwav use perf_mod , only : t_startf, t_stopf + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper ! input/output variables type(ESMF_GridComp) :: gcomp @@ -44,6 +45,7 @@ subroutine med_phases_post_ice(gcomp, rc) character(len=*),parameter :: subname='(med_phases_post_ice)' !------------------------------------------------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_post_ice", "B") call t_startf('MED:'//subname) rc = ESMF_SUCCESS @@ -105,6 +107,7 @@ subroutine med_phases_post_ice(gcomp, rc) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO) end if + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_post_ice", "E") end subroutine med_phases_post_ice end module med_phases_post_ice_mod diff --git a/mediator/med_phases_post_ocn_mod.F90 b/mediator/med_phases_post_ocn_mod.F90 index 454dc7b13..29b191b02 100644 --- a/mediator/med_phases_post_ocn_mod.F90 +++ b/mediator/med_phases_post_ocn_mod.F90 @@ -26,12 +26,13 @@ subroutine med_phases_post_ocn(gcomp, rc) use med_utils_mod , only : chkerr => med_utils_ChkErr use med_constants_mod , only : dbug_flag => med_constants_dbug_flag use med_map_mod , only : med_map_field_packed - use med_internalstate_mod , only : InternalState + use med_internalstate_mod , only : InternalState, maintask use med_internalstate_mod , only : compice, compocn, compwav use med_phases_history_mod , only : med_phases_history_write_comp use med_phases_prep_glc_mod , only : med_phases_prep_glc_accum_ocn use med_methods_mod , only : med_methods_FB_check_wtracers use perf_mod , only : t_startf, t_stopf + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper ! input/output variables type(ESMF_GridComp) :: gcomp @@ -44,6 +45,7 @@ subroutine med_phases_post_ocn(gcomp, rc) !--------------------------------------- rc = ESMF_SUCCESS + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_post_ocn", "B") call t_startf('MED:'//subname) if (dbug_flag > 20) then @@ -107,6 +109,7 @@ subroutine med_phases_post_ocn(gcomp, rc) end if call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_post_ocn", "E") end subroutine med_phases_post_ocn end module med_phases_post_ocn_mod diff --git a/mediator/med_phases_post_wav_mod.F90 b/mediator/med_phases_post_wav_mod.F90 index 0c8004c96..78296f70f 100644 --- a/mediator/med_phases_post_wav_mod.F90 +++ b/mediator/med_phases_post_wav_mod.F90 @@ -24,10 +24,11 @@ subroutine med_phases_post_wav(gcomp, rc) use med_methods_mod , only : FB_diagnose => med_methods_FB_diagnose use med_methods_mod , only : med_methods_FB_check_wtracers use med_map_mod , only : med_map_field_packed - use med_internalstate_mod , only : InternalState + use med_internalstate_mod , only : InternalState, maintask use med_internalstate_mod , only : compwav, compatm, compocn, compice use med_phases_history_mod, only : med_phases_history_write_comp use perf_mod , only : t_startf, t_stopf + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper ! input/output variables type(ESMF_GridComp) :: gcomp @@ -39,6 +40,7 @@ subroutine med_phases_post_wav(gcomp, rc) character(len=*),parameter :: subname='(med_phases_post_wav)' !------------------------------------------------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_post_wav", "B") call t_startf('MED:'//subname) rc = ESMF_SUCCESS @@ -103,6 +105,7 @@ subroutine med_phases_post_wav(gcomp, rc) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO) end if + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_post_wav", "E") end subroutine med_phases_post_wav end module med_phases_post_wav_mod diff --git a/mediator/med_phases_prep_atm_mod.F90 b/mediator/med_phases_prep_atm_mod.F90 index 149790bb6..affb7f408 100644 --- a/mediator/med_phases_prep_atm_mod.F90 +++ b/mediator/med_phases_prep_atm_mod.F90 @@ -24,6 +24,7 @@ module med_phases_prep_atm_mod use perf_mod , only : t_startf, t_stopf use med_phases_aofluxes_mod, only : med_aofluxes_map_xgrid2agrid_output use med_phases_aofluxes_mod, only : med_aofluxes_map_ogrid2agrid_output + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper implicit none private @@ -61,6 +62,7 @@ subroutine med_phases_prep_atm(gcomp, rc) character(len=*),parameter :: subname='(med_phases_prep_atm)' !------------------------------------------------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_atm", "B") call t_startf('MED:'//subname) rc = ESMF_SUCCESS @@ -254,6 +256,7 @@ subroutine med_phases_prep_atm(gcomp, rc) end if call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_atm", "E") end subroutine med_phases_prep_atm !----------------------------------------------------------------------------- diff --git a/mediator/med_phases_prep_glc_mod.F90 b/mediator/med_phases_prep_glc_mod.F90 index 91ced9ef4..901c3bdca 100644 --- a/mediator/med_phases_prep_glc_mod.F90 +++ b/mediator/med_phases_prep_glc_mod.F90 @@ -52,7 +52,7 @@ module med_phases_prep_glc_mod use wtracers_mod , only : wtracers_present, wtracers_get_num_tracers, WTRACERS_SUFFIX use perf_mod , only : t_startf, t_stopf use shr_log_mod , only : shr_log_error - + implicit none private diff --git a/mediator/med_phases_prep_ice_mod.F90 b/mediator/med_phases_prep_ice_mod.F90 index c82e53af5..20cfdd734 100644 --- a/mediator/med_phases_prep_ice_mod.F90 +++ b/mediator/med_phases_prep_ice_mod.F90 @@ -42,6 +42,7 @@ subroutine med_phases_prep_ice(gcomp, rc) use med_internalstate_mod , only : coupling_mode use esmFlds , only : med_fldList_GetFldListTo use perf_mod , only : t_startf, t_stopf + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper ! input/output variables type(ESMF_GridComp) :: gcomp @@ -60,6 +61,7 @@ subroutine med_phases_prep_ice(gcomp, rc) character(len=*),parameter :: subname='(med_phases_prep_ice)' !--------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_ice", "B") call t_startf('MED:'//subname) if (dbug_flag > 5) then @@ -164,6 +166,7 @@ subroutine med_phases_prep_ice(gcomp, rc) endif call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_ice", "E") end subroutine med_phases_prep_ice end module med_phases_prep_ice_mod diff --git a/mediator/med_phases_prep_ocn_mod.F90 b/mediator/med_phases_prep_ocn_mod.F90 index ea1939bbc..52b28a352 100644 --- a/mediator/med_phases_prep_ocn_mod.F90 +++ b/mediator/med_phases_prep_ocn_mod.F90 @@ -25,6 +25,7 @@ module med_phases_prep_ocn_mod use esmFlds , only : med_fldList_GetfldListTo, med_fldlist_type use med_internalstate_mod , only : compocn, compatm, compice, coupling_mode use perf_mod , only : t_startf, t_stopf + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper implicit none private @@ -113,6 +114,7 @@ subroutine med_phases_prep_ocn_accum(gcomp, rc) character(len=*), parameter :: subname='(med_phases_prep_ocn_accum)' !--------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_ocn_accum", "B") call t_startf('MED:'//subname) if (dbug_flag > 20) then call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO) @@ -276,6 +278,7 @@ subroutine med_phases_prep_ocn_accum(gcomp, rc) end if call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_ocn_accum", "E") end subroutine med_phases_prep_ocn_accum !----------------------------------------------------------------------------- @@ -298,6 +301,7 @@ subroutine med_phases_prep_ocn_avg(gcomp, rc) !--------------------------------------- rc = ESMF_SUCCESS + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_ocn_avg", "B") call t_startf('MED:'//subname) if (dbug_flag > 20) then @@ -357,6 +361,7 @@ subroutine med_phases_prep_ocn_avg(gcomp, rc) call t_stopf('MED:'//subname) first_call = .false. + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_ocn_avg", "E") end subroutine med_phases_prep_ocn_avg !----------------------------------------------------------------------------- diff --git a/mediator/med_phases_prep_rof_mod.F90 b/mediator/med_phases_prep_rof_mod.F90 index b164efe74..45261a885 100644 --- a/mediator/med_phases_prep_rof_mod.F90 +++ b/mediator/med_phases_prep_rof_mod.F90 @@ -31,7 +31,7 @@ module med_phases_prep_rof_mod use med_field_info_mod , only : med_field_info_esmf_fieldcreate use perf_mod , only : t_startf, t_stopf use shr_log_mod , only : shr_log_error - + implicit none private diff --git a/mediator/med_phases_prep_wav_mod.F90 b/mediator/med_phases_prep_wav_mod.F90 index bd97b4006..d55bce8c7 100644 --- a/mediator/med_phases_prep_wav_mod.F90 +++ b/mediator/med_phases_prep_wav_mod.F90 @@ -23,6 +23,7 @@ module med_phases_prep_wav_mod use esmFlds , only : med_fldList_GetfldListTo use med_internalstate_mod , only : compatm, compwav use perf_mod , only : t_startf, t_stopf + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper implicit none private @@ -92,6 +93,7 @@ subroutine med_phases_prep_wav_accum(gcomp, rc) character(len=*), parameter :: subname='(med_phases_prep_wav_accum)' !--------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_wav_accum", "B") call t_startf('MED:'//subname) if (dbug_flag > 20) then call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO) @@ -130,7 +132,7 @@ subroutine med_phases_prep_wav_accum(gcomp, rc) end if !--------------------------------------- - !--- merge all fields to wav + !--- merge all fields to wav !--------------------------------------- call med_merge_auto(& is_local%wrap%med_coupling_active(:,compwav), & @@ -155,6 +157,7 @@ subroutine med_phases_prep_wav_accum(gcomp, rc) end if call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_wav_accum", "E") end subroutine med_phases_prep_wav_accum !----------------------------------------------------------------------------- @@ -176,6 +179,7 @@ subroutine med_phases_prep_wav_avg(gcomp, rc) !--------------------------------------- rc = ESMF_SUCCESS + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_wav_avg", "B") call t_startf('MED:'//subname) if (dbug_flag > 20) then @@ -232,5 +236,6 @@ subroutine med_phases_prep_wav_avg(gcomp, rc) end if call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_prep_wav_avg", "E") end subroutine med_phases_prep_wav_avg end module med_phases_prep_wav_mod diff --git a/mediator/med_phases_restart_mod.F90 b/mediator/med_phases_restart_mod.F90 index 59dbbbf51..4161816f8 100644 --- a/mediator/med_phases_restart_mod.F90 +++ b/mediator/med_phases_restart_mod.F90 @@ -19,6 +19,7 @@ module med_phases_restart_mod use shr_is_restart_fh_mod , only : log_restart_fh #endif use shr_log_mod , only : shr_log_error + use med_ufs_trace_wrapper_mod, only : ufs_trace_wrapper implicit none private @@ -198,6 +199,7 @@ subroutine med_phases_restart_write(gcomp, rc) character(len=*), parameter :: subname='(med_phases_restart_write)' !--------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_restart_write", "B") call t_startf('MED:'//subname) if (dbug_flag > 5) then call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO) @@ -508,6 +510,7 @@ subroutine med_phases_restart_write(gcomp, rc) endif call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_restart_write", "E") end subroutine med_phases_restart_write !=============================================================================== @@ -543,6 +546,7 @@ subroutine med_phases_restart_read(gcomp, rc) character(ESMF_MAXSTR) :: restart_pfile ! Local path to restart pointer filename character(len=*), parameter :: subname='(med_phases_restart_read)' !--------------------------------------- + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_restart_read", "B") call t_startf('MED:'//subname) call ESMF_LogWrite(trim(subname)//": called", ESMF_LOGMSG_INFO) rc = ESMF_SUCCESS @@ -661,6 +665,7 @@ subroutine med_phases_restart_read(gcomp, rc) call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO) call t_stopf('MED:'//subname) + if (maintask) call ufs_trace_wrapper("cmeps", "med_phases_restart_read", "E") end subroutine med_phases_restart_read !=============================================================================== diff --git a/mediator/med_ufs_trace_wrapper.F90 b/mediator/med_ufs_trace_wrapper.F90 new file mode 100644 index 000000000..8a0415a95 --- /dev/null +++ b/mediator/med_ufs_trace_wrapper.F90 @@ -0,0 +1,38 @@ +module med_ufs_trace_wrapper_mod + +#ifdef UFS_TRACING + use ufs_trace_mod, only: ufs_trace_init, ufs_trace, ufs_trace_finalize +#endif + + implicit none + + private + + public ufs_trace_init_wrapper + public ufs_trace_wrapper + public ufs_trace_finalize_wrapper + +contains + + subroutine ufs_trace_init_wrapper() +#ifdef UFS_TRACING + call ufs_trace_init +#endif + return + end subroutine ufs_trace_init_wrapper + + subroutine ufs_trace_wrapper(component, routine, ph) + character(len=*), intent(in) :: component, routine, ph +#ifdef UFS_TRACING + call ufs_trace(component, routine, ph) +#endif + return + end subroutine ufs_trace_wrapper + + subroutine ufs_trace_finalize_wrapper() +#ifdef UFS_TRACING + call ufs_trace_finalize +#endif + end subroutine ufs_trace_finalize_wrapper + +end module med_ufs_trace_wrapper_mod diff --git a/ufs/ccpp/config/ccpp_prebuild_config.py b/ufs/ccpp/config/ccpp_prebuild_config.py index 8d8963bad..c9c3add7d 100755 --- a/ufs/ccpp/config/ccpp_prebuild_config.py +++ b/ufs/ccpp/config/ccpp_prebuild_config.py @@ -10,7 +10,7 @@ # Query required information/s # ############################################################################### -fv3_path = os.environ['FV3_PATH'] +ufsatm_path = os.environ['UFSATM_PATH'] ############################################################################### # Definitions # @@ -24,8 +24,8 @@ # dependencies of these files to the list. VARIABLE_DEFINITION_FILES = [ # actual variable definition files - '{}/ccpp/framework/src/ccpp_types.F90'.format(fv3_path), - '{}/ccpp/physics/physics/hooks/machine.F'.format(fv3_path), + '{}/ccpp/framework/src/ccpp_types.F90'.format(ufsatm_path), + '{}/ccpp/physics/physics/hooks/machine.F'.format(ufsatm_path), 'CMEPS/ufs/ccpp/data/MED_typedefs.F90', 'CMEPS/ufs/ccpp/data/MED_data.F90' ] @@ -58,13 +58,13 @@ # Add all physics scheme files relative to basedir SCHEME_FILES = [ - '{}/ccpp/physics/physics/SFC_Models/Ocean/UFS/sfc_ocean.F'.format(fv3_path), - '{}/ccpp/physics/physics/SFC_Layer/UFS/sfc_diff.f'.format(fv3_path), - '{}/ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part1.F90'.format(fv3_path), - '{}/ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part2.F90'.format(fv3_path), - '{}/ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.F90'.format(fv3_path), - '{}/ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90'.format(fv3_path), - '{}/ccpp/physics/physics/SFC_Layer/UFS/sfc_diag.f'.format(fv3_path) + '{}/ccpp/physics/physics/SFC_Models/Ocean/UFS/sfc_ocean.F'.format(ufsatm_path), + '{}/ccpp/physics/physics/SFC_Layer/UFS/sfc_diff.f'.format(ufsatm_path), + '{}/ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part1.F90'.format(ufsatm_path), + '{}/ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part2.F90'.format(ufsatm_path), + '{}/ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.F90'.format(ufsatm_path), + '{}/ccpp/physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90'.format(ufsatm_path), + '{}/ccpp/physics/physics/SFC_Layer/UFS/sfc_diag.f'.format(ufsatm_path) ] # Default build dir, relative to current working directory, diff --git a/ufs/ccpp/data/MED_typedefs.F90 b/ufs/ccpp/data/MED_typedefs.F90 index 649ee9b69..8e98bda9b 100644 --- a/ufs/ccpp/data/MED_typedefs.F90 +++ b/ufs/ccpp/data/MED_typedefs.F90 @@ -5,7 +5,7 @@ module MED_typedefs !! use machine, only: kind_phys use physcons, only: con_hvap, con_cp, con_rd, con_eps, con_rocp - use physcons, only: con_epsm1, con_fvirt, con_g + use physcons, only: con_epsm1, con_fvirt, con_g use physcons, only: con_tice, karman implicit none @@ -22,6 +22,7 @@ module MED_typedefs !! type MED_init_type integer :: im !< horizontal loop extent + integer :: nCol !< horizontal dimension end type MED_init_type !! \section arg_table_MED_statein_type @@ -69,7 +70,7 @@ module MED_typedefs real(kind=kind_phys), pointer :: prslki(:) => null() !< Exner function ratio bt midlayer and interface at 1st layer logical, pointer :: wet(:) => null() !< flag indicating presence of some ocean or lake surface area fraction integer, pointer :: use_lake_model(:)=>null() !< 0 for points that don't use a lake model, lkm for points that do - real (kind=kind_phys),pointer :: lake_t2m (:) => null() !< 2 meter temperature from CLM Lake model + real (kind=kind_phys),pointer :: lake_t2m (:) => null() !< 2 meter temperature from CLM Lake model real (kind=kind_phys),pointer :: lake_q2m (:) => null() !< 2 meter humidity from CLM Lake model real(kind=kind_phys), pointer :: wind(:) => null() !< wind speed at lowest model level (m/s) logical, pointer :: flag_iter(:) => null() !< flag for iteration @@ -83,7 +84,7 @@ module MED_typedefs real(kind=kind_phys), pointer :: ep1d_water(:) => null() !< surface upward potential latent heat flux over water (W/m2) real(kind=kind_phys), pointer :: tsurf_water(:) => null() !< surface skin temperature after iteration over water (K) real(kind=kind_phys), pointer :: uustar_water(:) => null() !< surface friction velocity over water (m/s) - real(kind=kind_phys), pointer :: rb_water(:) => null() !< bulk Richardson number at the surface over water + real(kind=kind_phys), pointer :: rb_water(:) => null() !< bulk Richardson number at the surface over water real(kind=kind_phys), pointer :: stress_water(:) => null() !< surface wind stress over water real(kind=kind_phys), pointer :: ffhh_water(:) => null() !< Monin-Obukhov similarity function for heat over water real(kind=kind_phys), pointer :: fh2_water(:) => null() !< Monin-Obukhov similarity parameter for heat at 2m over water @@ -96,13 +97,13 @@ module MED_typedefs real(kind=kind_phys), pointer :: sigmaf(:) => null() !< areal fractional cover of green vegetation bounded on the bottom logical, pointer :: dry(:) => null() !< flag indicating presence of some land surface area fraction real(kind=kind_phys), pointer :: tsfcl(:) => null() !< surface skin temperature over land (K) - real(kind=kind_phys), pointer :: tsurf_land(:) => null() !< surface skin temperature after iteration over land (K) + real(kind=kind_phys), pointer :: tsurf_land(:) => null() !< surface skin temperature after iteration over land (K) real(kind=kind_phys), pointer :: uustar_land(:) => null() !< surface friction velocity over land (m/s) - real(kind=kind_phys), pointer :: cd_land(:) => null() !< surface exchange coeff for momentum over land - real(kind=kind_phys), pointer :: cdq_land(:) => null() !< surface exchange coeff heat surface exchange coeff heat & moisture over ocean moisture over land + real(kind=kind_phys), pointer :: cd_land(:) => null() !< surface exchange coeff for momentum over land + real(kind=kind_phys), pointer :: cdq_land(:) => null() !< surface exchange coeff heat surface exchange coeff heat & moisture over ocean moisture over land real(kind=kind_phys), pointer :: rb_land(:) => null() !< bulk Richardson number at the surface over land - real(kind=kind_phys), pointer :: stress_land(:) => null() !< surface wind stress over land - real(kind=kind_phys), pointer :: ffmm_land(:) => null() !< Monin-Obukhov similarity function for momentum over land + real(kind=kind_phys), pointer :: stress_land(:) => null() !< surface wind stress over land + real(kind=kind_phys), pointer :: ffmm_land(:) => null() !< Monin-Obukhov similarity function for momentum over land real(kind=kind_phys), pointer :: ffhh_land(:) => null() !< Monin-Obukhov similarity function for heat over land real(kind=kind_phys), pointer :: fm10_land(:) => null() !< Monin-Obukhov similarity parameter for momentum at 10m over land real(kind=kind_phys), pointer :: fh2_land(:) => null() !< Monin-Obukhov similarity parameter for heat at 2m over land @@ -121,10 +122,10 @@ module MED_typedefs ! ice, not used to calculate aofluxes logical, pointer :: icy(:) => null() !< flag indicating presence of some sea ice surface area fraction real(kind=kind_phys), pointer :: tisfc(:) => null() !< surface skin temperature over ice (K) - real(kind=kind_phys), pointer :: tsurf_ice(:) => null() !< surface skin temperature after iteration over ice (K) + real(kind=kind_phys), pointer :: tsurf_ice(:) => null() !< surface skin temperature after iteration over ice (K) real(kind=kind_phys), pointer :: uustar_ice(:) => null() !< surface friction velocity over ice (m/s) - real(kind=kind_phys), pointer :: cd_ice(:) => null() !< surface exchange coeff for momentum over ice - real(kind=kind_phys), pointer :: cdq_ice(:) => null() !< surface exchange coeff heat surface exchange coeff heat & moisture over ocean moisture over ice + real(kind=kind_phys), pointer :: cd_ice(:) => null() !< surface exchange coeff for momentum over ice + real(kind=kind_phys), pointer :: cdq_ice(:) => null() !< surface exchange coeff heat surface exchange coeff heat & moisture over ocean moisture over ice real(kind=kind_phys), pointer :: rb_ice(:) => null() !< bulk Richardson number at the surface over ice real(kind=kind_phys), pointer :: stress_ice(:) => null() !< surface wind stress over ice real(kind=kind_phys), pointer :: ffmm_ice(:) => null() !< Monin-Obukhov similarity function for momentum over ice @@ -168,12 +169,13 @@ module MED_typedefs type MED_control_type logical :: lseaspray !< flag for sea spray parameterization logical :: use_med_flux !< flag for using atmosphere-ocean fluxes form mediator + logical :: use_cdeps_inline !< default no data from cdeps inline integer :: ivegsrc !< land use dataset choice 0 => USGS, 1 => IGBP, 2 => UMD integer :: lsm !< flag for land surface model integer :: lsm_noahmp !< flag for NOAH MP land surface model logical :: redrag !< flag for reduced drag coeff. over sea integer :: sfc_z0_type !< surface roughness options over water - integer :: icplocn2atm !< flag controlling whether to consider ocean current in air-sea flux calculation + logical :: use_oceanuv !< flag controlling whether to consider ocean current in air-sea flux calculation logical :: thsfc_loc !< flag for reference pressure in theta calculation integer :: nstf_name(5) !< NSSTM flag: off/uncoupled/coupled=0/1/2 integer :: lkm !< 0 = no lake model, 1 = lake model, 2 = lake & nsst on lake points @@ -214,6 +216,12 @@ module MED_typedefs type MED_coupling_type real(kind=kind_phys), pointer :: dtsfcin_med(:) => null() !< sfc latent heat flux over ocean real(kind=kind_phys), pointer :: dqsfcin_med(:) => null() !< sfc sensible heat flux over ocean + !-- lake surface temperature from cdeps inline + real(kind=kind_phys), pointer :: mask_dat (:) => null() !< land-sea mask from cdeps inline + real(kind=kind_phys), pointer :: tsfco_dat (:) => null() !< sfc temperature from cdeps inline + real(kind=kind_phys), pointer :: tice_dat (:) => null() !< sfc temperature over ice from cdeps inline + real(kind=kind_phys), pointer :: hice_dat (:) => null() !< sfc ice thickness from cdeps inline + real(kind=kind_phys), pointer :: fice_dat (:) => null() !< sfc ice fraction from cdeps inline contains procedure :: create => coupling_create !< allocate array data end type MED_coupling_type @@ -251,7 +259,7 @@ module MED_typedefs real(kind=kind_phys), pointer :: fice(:) => null() !< ice fraction over open water real(kind=kind_phys), pointer :: hice(:) => null() !< sea ice thickness (m) real(kind=kind_phys), pointer :: tsfco(:) => null() !< sea surface temperature - real(kind=kind_phys), pointer :: usfco(:) => null() !< sea surface ocean current (zonal) + real(kind=kind_phys), pointer :: usfco(:) => null() !< sea surface ocean current (zonal) real(kind=kind_phys), pointer :: vsfco(:) => null() !< sea surface ocean current (merdional) real(kind=kind_phys), pointer :: uustar(:) => null() !< boundary layer parameter real(kind=kind_phys), pointer :: tsfc(:) => null() !< surface skin temperature @@ -643,10 +651,11 @@ subroutine control_initialize(model) model%lseaspray = .false. model%use_med_flux = .false. + model%use_cdeps_inline = .false. model%ivegsrc = 2 model%redrag = .false. model%sfc_z0_type = 0 - model%icplocn2atm = 0 + model%use_oceanuv = .false. model%thsfc_loc = .true. model%lsm = 1 model%lsm_noahmp = 2 @@ -679,15 +688,29 @@ subroutine control_initialize(model) end subroutine control_initialize - subroutine coupling_create(coupling, im) + subroutine coupling_create(coupling, im, model) implicit none class(MED_coupling_type) :: coupling integer, intent(in) :: im + type(MED_control_type), intent(in) :: model allocate(coupling%dtsfcin_med(im)) coupling%dtsfcin_med = clear_val allocate(coupling%dqsfcin_med(im)) coupling%dqsfcin_med = clear_val + + if (model%use_cdeps_inline) then + allocate (coupling%tsfco_dat(im)) + coupling%tsfco_dat = clear_val + allocate (coupling%mask_dat(im)) + coupling%mask_dat = clear_val + allocate (coupling%tice_dat(im)) + coupling%tice_dat = clear_val + allocate (coupling%hice_dat(im)) + coupling%hice_dat = clear_val + allocate (coupling%fice_dat(im)) + coupling%fice_dat = clear_val + endif end subroutine coupling_create diff --git a/ufs/ccpp/data/MED_typedefs.meta b/ufs/ccpp/data/MED_typedefs.meta index 046e4bfa6..3731b84b2 100644 --- a/ufs/ccpp/data/MED_typedefs.meta +++ b/ufs/ccpp/data/MED_typedefs.meta @@ -12,6 +12,12 @@ units = count dimensions = () type = integer +[nCol] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer ######################################################################## [ccpp-table-properties] @@ -26,84 +32,84 @@ standard_name = surface_air_pressure long_name = surface pressure units = Pa - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ugrs] - standard_name = x_wind_at_surface_adjacent_layer + standard_name = physics_timestep_initial_x_wind_at_surface_adjacent_layer long_name = zonal wind at lowest model layer units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [vgrs] - standard_name = y_wind_at_surface_adjacent_layer + standard_name = physics_timestep_initial_y_wind_at_surface_adjacent_layer long_name = meridional wind at lowest model layer units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tgrs] - standard_name = air_temperature_at_surface_adjacent_layer + standard_name = physics_timestep_initial_air_temperature_at_surface_adjacent_layer long_name = mean temperature at lowest model layer units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [qgrs] - standard_name = specific_humidity_at_surface_adjacent_layer + standard_name = physics_timestep_initial_specific_humidity_at_surface_adjacent_layer long_name = water vapor specific humidity at lowest model layer units = kg kg-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [prsl] standard_name = air_pressure_at_surface_adjacent_layer long_name = mean pressure at lowest model layer units = Pa - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [zlvl] standard_name = height_above_ground_at_lowest_model_layer long_name = layer 1 height above ground (not MSL) units = m - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [prsik] standard_name = surface_dimensionless_exner_function long_name = dimensionless Exner function at lowest model interface units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [prslk] standard_name = dimensionless_exner_function_at_surface_adjacent_layer long_name = dimensionless Exner function at lowest model layer units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [u10m] standard_name = x_wind_at_10m long_name = 10 meter u wind speed units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [v10m] standard_name = y_wind_at_10m long_name = 10 meter v wind speed units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [stc] standard_name = soil_temperature long_name = soil temperature units = K - dimensions = (horizontal_loop_extent,vertical_dimension_of_soil) + dimensions = (horizontal_dimension,vertical_dimension_of_soil) type = real kind = kind_phys @@ -117,31 +123,31 @@ name = MED_stateout_type type = ddt [gu0] - standard_name = x_wind_of_new_state_at_surface_adjacent_layer + standard_name = x_wind_at_surface_adjacent_layer long_name = zonal wind at lowest model layer updated by physics units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [gv0] - standard_name = y_wind_of_new_state_at_surface_adjacent_layer + standard_name = y_wind_at_surface_adjacent_layer long_name = meridional wind at lowest model layer updated by physics units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [gt0] - standard_name = air_temperature_of_new_state_at_surface_adjacent_layer + standard_name = air_temperature_at_surface_adjacent_layer long_name = temperature at lowest model layer updated by physics units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [gq0] - standard_name = specific_humidity_of_new_state_at_surface_adjacent_layer + standard_name = specific_humidity_at_surface_adjacent_layer long_name = water vapor specific humidity at lowest model layer updated by physics units = kg kg-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys @@ -158,55 +164,55 @@ standard_name = surface_skin_temperature_over_water long_name = surface skin temperature over water units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cd_water] standard_name = surface_drag_coefficient_for_momentum_in_air_over_water long_name = surface exchange coeff for momentum over water units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cdq_water] standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_water long_name = surface exchange coeff heat surface exchange coeff heat & moisture over ocean moisture over water units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ffmm_water] standard_name = Monin_Obukhov_similarity_function_for_momentum_over_water long_name = Monin-Obukhov similarity function for momentum over water units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [fm10_water] standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_water long_name = Monin-Obukhov similarity parameter for momentum at 10m over water units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [prslki] standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer long_name = Exner function ratio bt midlayer and interface at 1st layer units = ratio - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [wet] standard_name = flag_nonzero_wet_surface_fraction long_name = flag indicating presence of some ocean or lake surface area fraction units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = logical [lake_t2m] standard_name = temperature_at_2m_from_clm_lake long_name = temperature at 2m from clm lake units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys active = (control_for_lake_model_selection == 2) @@ -214,7 +220,7 @@ standard_name = specific_humidity_at_2m_from_clm_lake long_name = specific humidity at 2m from clm lake units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys active = (control_for_lake_model_selection == 2) @@ -222,557 +228,557 @@ standard_name = flag_for_using_lake_model long_name = flag indicating lake points using a lake model units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = integer [wind] standard_name = wind_speed_at_lowest_model_layer long_name = wind speed at lowest model level units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [flag_iter] standard_name = flag_for_iteration long_name = flag for iteration units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = logical [flag_lakefreeze] standard_name = flag_for_lake_water_freeze long_name = flag for lake water freeze units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = logical [qss_water] standard_name = surface_specific_humidity_over_water long_name = surface air saturation specific humidity over water units = kg kg-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cmm_water] standard_name = surface_drag_wind_speed_for_momentum_in_air_over_water long_name = momentum exchange coefficient over water units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [chh_water] standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_water long_name = thermal exchange coefficient over water units = kg m-2 s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [gflx_water] standard_name = upward_heat_flux_in_soil_over_water long_name = soil heat flux over water units = W m-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [evap_water] standard_name = kinematic_surface_upward_latent_heat_flux_over_water long_name = kinematic surface upward latent heat flux over water units = kg kg-1 m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [evap_land] standard_name = kinematic_surface_upward_latent_heat_flux_over_land long_name = kinematic surface upward latent heat flux over land units = kg kg-1 m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [evap_ice] standard_name = kinematic_surface_upward_latent_heat_flux_over_ice long_name = kinematic surface upward latent heat flux over ice units = kg kg-1 m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [hflx_water] standard_name = kinematic_surface_upward_sensible_heat_flux_over_water long_name = kinematic surface upward sensible heat flux over water units = K m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [hflx_land] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land long_name = kinematic surface upward sensible heat flux over land units = K m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [hflx_ice] standard_name = kinematic_surface_upward_sensible_heat_flux_over_ice long_name = kinematic surface upward sensible heat flux over ice units = K m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ep1d_water] standard_name = surface_upward_potential_latent_heat_flux_over_water long_name = surface upward potential latent heat flux over water units = W m-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [zvfun] standard_name = function_of_surface_roughness_length_and_green_vegetation_fraction long_name = function of surface roughness length and green vegetation fraction units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [sigmaf] standard_name = bounded_vegetation_area_fraction long_name = areal fractional cover of green vegetation bounded on the bottom units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [z01d] standard_name = perturbation_of_momentum_roughness_length long_name = perturbation of momentum roughness length units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [zt1d] standard_name = perturbation_of_heat_to_momentum_roughness_length_ratio long_name = perturbation of heat to momentum roughness length ratio units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [dry] standard_name = flag_nonzero_land_surface_fraction long_name = flag indicating presence of some land surface area fraction units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = logical [icy] standard_name = flag_nonzero_sea_ice_surface_fraction long_name = flag indicating presence of some sea ice surface area fraction units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = logical [tsfcl] standard_name = surface_skin_temperature_over_land long_name = surface skin temperature over land units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tisfc] standard_name = surface_skin_temperature_over_ice long_name = surface skin temperature over ice units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tsurf_water] standard_name = surface_skin_temperature_after_iteration_over_water long_name = surface skin temperature after iteration over water units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tsurf_land] standard_name = surface_skin_temperature_after_iteration_over_land long_name = surface skin temperature after iteration over land units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tsurf_ice] standard_name = surface_skin_temperature_after_iteration_over_ice long_name = surface skin temperature after iteration over ice units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [uustar_water] standard_name = surface_friction_velocity_over_water long_name = surface friction velocity over water units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [uustar_land] standard_name = surface_friction_velocity_over_land long_name = surface friction velocity over land units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [uustar_ice] standard_name = surface_friction_velocity_over_ice long_name = surface friction velocity over ice units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cd] standard_name = surface_drag_coefficient_for_momentum_in_air long_name = surface exchange coeff for momentum units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cd_land] standard_name = surface_drag_coefficient_for_momentum_in_air_over_land long_name = surface exchange coeff for momentum over land units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cd_ice] standard_name = surface_drag_coefficient_for_momentum_in_air_over_ice long_name = surface exchange coeff for momentum over ice units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cdq] standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air long_name = surface exchange coeff heat & moisture units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cdq_land] standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_land long_name = surface exchange coeff heat & moisture over land units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cdq_ice] standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice long_name = surface exchange coeff heat & moisture over ice units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [rb_water] standard_name = bulk_richardson_number_at_lowest_model_level_over_water long_name = bulk Richardson number at the surface over water units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [rb_land] standard_name = bulk_richardson_number_at_lowest_model_level_over_land long_name = bulk Richardson number at the surface over land units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [rb_ice] standard_name = bulk_richardson_number_at_lowest_model_level_over_ice long_name = bulk Richardson number at the surface over ice units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [stress_water] standard_name = surface_wind_stress_over_water long_name = surface wind stress over water units = m2 s-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [stress_land] standard_name = surface_wind_stress_over_land long_name = surface wind stress over land units = m2 s-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [stress_ice] standard_name = surface_wind_stress_over_ice long_name = surface wind stress over ice units = m2 s-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ffmm_land] standard_name = Monin_Obukhov_similarity_function_for_momentum_over_land long_name = Monin-Obukhov similarity function for momentum over land units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ffmm_ice] standard_name = Monin_Obukhov_similarity_function_for_momentum_over_ice long_name = Monin-Obukhov similarity function for momentum over ice units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ffhh_water] standard_name = Monin_Obukhov_similarity_function_for_heat_over_water long_name = Monin-Obukhov similarity function for heat over water units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ffhh_land] standard_name = Monin_Obukhov_similarity_function_for_heat_over_land long_name = Monin-Obukhov similarity function for heat over land units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ffhh_ice] standard_name = Monin_Obukhov_similarity_function_for_heat_over_ice long_name = Monin-Obukhov similarity function for heat over ice units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [fm10_land] standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_land long_name = Monin-Obukhov similarity parameter for momentum at 10m over land units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [fm10_ice] standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ice long_name = Monin-Obukhov similarity parameter for momentum at 10m over ice units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [fh2_water] standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_water long_name = Monin-Obukhov similarity parameter for heat at 2m over water units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [fh2_land] standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_land long_name = Monin-Obukhov similarity parameter for heat at 2m over land units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [fh2_ice] standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_ice long_name = Monin-Obukhov similarity parameter for heat at 2m over ice units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ztmax_water] standard_name = bounded_surface_roughness_length_for_heat_over_water long_name = bounded surface roughness length for heat over water units = m - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ztmax_land] standard_name = bounded_surface_roughness_length_for_heat_over_land long_name = bounded surface roughness length for heat over land units = m - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ztmax_ice] standard_name = bounded_surface_roughness_length_for_heat_over_ice long_name = bounded surface roughness length for heat over ice units = m - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [flag_guess] standard_name = flag_for_guess_run long_name = flag for guess run units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = logical [flag_cice] standard_name = flag_for_cice long_name = flag for cice units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = logical [lake] standard_name = flag_nonzero_lake_surface_fraction long_name = flag indicating presence of some lake surface area fraction units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = logical [frland] standard_name = land_area_fraction_for_microphysics long_name = land area fraction used in microphysics schemes units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tprcp_water] standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_water long_name = total precipitation amount in each time step over water units = m - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tprcp_land] standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land long_name = total precipitation amount in each time step over land units = m - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tprcp_ice] standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice long_name = total precipitation amount in each time step over ice units = m - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [islmsk] standard_name = sea_land_ice_mask long_name = sea/land/ice mask (=0/1/2) units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = integer [islmsk_cice] standard_name = sea_land_ice_mask_cice long_name = sea/land/ice mask cice (=0/1/2) units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = integer [qss_land] standard_name = surface_specific_humidity_over_land long_name = surface air saturation specific humidity over land units = kg kg-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [qss_ice] standard_name = surface_specific_humidity_over_ice long_name = surface air saturation specific humidity over ice units = kg kg-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ep1d_ice] standard_name = surface_upward_potential_latent_heat_flux_over_ice long_name = surface upward potential latent heat flux over ice units = W m-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [gflx_ice] standard_name = upward_heat_flux_in_soil_over_ice long_name = soil heat flux over ice units = W m-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [rb] standard_name = bulk_richardson_number_at_lowest_model_level long_name = bulk Richardson number at the surface units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [hflxq] standard_name = kinematic_surface_upward_sensible_heat_flux_reduced_by_surface_roughness_and_vegetation long_name = kinematic surface upward sensible heat flux reduced by surface roughness and vegetation units = K m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [fh2] standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m long_name = Monin-Obukhov similarity parameter for heat at 2m units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [fm10] standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m long_name = Monin-Obukhov similarity parameter for momentum at 10m units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [chh_land] standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land long_name = thermal exchange coefficient over land units = kg m-2 s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [chh_ice] standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice long_name = thermal exchange coefficient over ice units = kg m-2 s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cmm_land] standard_name = surface_drag_wind_speed_for_momentum_in_air_over_land long_name = momentum exchange coefficient over land units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cmm_ice] standard_name = surface_drag_wind_speed_for_momentum_in_air_over_ice long_name = momentum exchange coefficient over ice units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ep1d] standard_name = surface_upward_potential_latent_heat_flux long_name = surface upward potential latent heat flux units = W m-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ep1d_land] standard_name = surface_upward_potential_latent_heat_flux_over_land long_name = surface upward potential latent heat flux over land units = W m-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [hffac] standard_name = surface_upward_sensible_heat_flux_reduction_factor long_name = surface upward sensible heat flux reduction factor from canopy heat storage units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [stress] standard_name = surface_wind_stress long_name = surface wind stress units = m2 s-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [gflx] standard_name = upward_heat_flux_in_soil long_name = soil heat flux units = W m-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [gflx_land] standard_name = upward_heat_flux_in_soil_over_land long_name = soil heat flux over land units = W m-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys @@ -797,6 +803,12 @@ units = flag dimensions = () type = logical +[use_cdeps_inline] + standard_name = do_cdeps_inline + long_name = flag for using data provided by CDEPS inline (default false) + units = flag + dimensions = () + type = logical [ivegsrc] standard_name = control_for_vegetation_dataset long_name = land use dataset choice @@ -911,12 +923,12 @@ units = flag dimensions = () type = logical -[icplocn2atm] - standard_name = control_for_air_sea_flux_computation_over_water +[use_oceanuv] + standard_name = do_air_sea_flux_computation_over_water long_name = air-sea flux option - units = 1 + units = flag dimensions = () - type = integer + type = logical [cpl_fire] standard_name = do_fire_coupling long_name = flag controlling fire_behavior collection (default off) @@ -1014,16 +1026,56 @@ standard_name = surface_upward_sensible_heat_flux_over_ocean_from_mediator long_name = sfc sensible heat flux input over ocean for coupling units = W m-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [dqsfcin_med] standard_name = surface_upward_latent_heat_flux_over_ocean_from_mediator long_name = sfc latent heat flux input over ocean for coupling units = W m-2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys +[tsfco_dat] + standard_name = sea_surface_temperature_from_data + long_name = sfc temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + active = (do_cdeps_inline) +[mask_dat] + standard_name = land_sea_mask_from_data + long_name = landmask + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + active = (do_cdeps_inline) +[tice_dat] + standard_name = surface_skin_temperature_over_ice_from_data + long_name = surface skin temperature over ice + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + active = (do_cdeps_inline) +[hice_dat] + standard_name = sea_ice_thickness_from_data + long_name = sea-ice thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + active = (do_cdeps_inline) +[fice_dat] + standard_name = sea_ice_area_fraction_of_sea_area_fraction_from_data + long_name = sea-ice concentration [0,1] + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + active = (do_cdeps_inline) ######################################################################## [ccpp-table-properties] @@ -1037,21 +1089,21 @@ standard_name = cell_area long_name = area of the grid cell units = m2 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [xlat_d] standard_name = latitude_in_degree long_name = latitude in degree north units = degree_north - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [xlon_d] standard_name = longitude_in_degree long_name = longitude in degree east units = degree_east - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys @@ -1068,258 +1120,258 @@ standard_name = vegetation_type_classification long_name = vegetation type for lsm units = index - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = integer [shdmax] standard_name = max_vegetation_area_fraction long_name = max fractional coverage of green vegetation units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [zorlw] standard_name = surface_roughness_length_over_water long_name = surface roughness length over water units = cm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [zorll] standard_name = surface_roughness_length_over_land long_name = surface roughness length over land units = cm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [zorli] standard_name = surface_roughness_length_over_ice long_name = surface roughness length over ice units = cm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [zorlwav] standard_name = surface_roughness_length_from_wave_model long_name = surface roughness length from wave model units = cm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [slmsk] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2 units = flag - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [lakefrac] standard_name = lake_area_fraction long_name = fraction of horizontal grid area occupied by lake units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [lakedepth] standard_name = lake_depth long_name = lake depth units = m - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [landfrac] standard_name = land_area_fraction long_name = fraction of horizontal grid area occupied by land units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tprcp] standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep long_name = total precipitation amount in each time step units = m - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [oceanfrac] standard_name = sea_area_fraction long_name = fraction of horizontal grid area occupied by ocean units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [fice] standard_name = sea_ice_area_fraction_of_sea_area_fraction long_name = ice fraction over open water units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [hice] standard_name = sea_ice_thickness long_name = sea ice thickness units = m - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tsfco] standard_name = sea_surface_temperature long_name = sea surface temperature units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [usfco] standard_name = x_ocean_current long_name = zonal current at ocean surface units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [vsfco] standard_name = y_ocean_current long_name = meridional current at ocean surface units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [uustar] standard_name = surface_friction_velocity long_name = boundary layer parameter units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tsfc] standard_name = surface_skin_temperature long_name = surface skin temperature units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [snodi] standard_name = surface_snow_thickness_water_equivalent_over_ice long_name = water equivalent snow depth over ice units = mm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [snodl] standard_name = surface_snow_thickness_water_equivalent_over_land long_name = water equivalent snow depth over land units = mm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [qss] standard_name = surface_specific_humidity long_name = surface air saturation specific humidity units = kg kg-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [weasdi] standard_name = water_equivalent_accumulated_snow_depth_over_ice long_name = water equiv of acc snow depth over land units = mm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [weasdl] standard_name = water_equivalent_accumulated_snow_depth_over_land long_name = water equiv of acc snow depth over land units = mm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [snowd] standard_name = lwe_surface_snow long_name = water equivalent snow depth units = mm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [weasd] standard_name = lwe_thickness_of_surface_snow_amount long_name = water equiv of acc snow depth over land and sea ice units = mm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ffhh] standard_name = Monin_Obukhov_similarity_function_for_heat long_name = Monin-Obukhov similarity function for heat units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [ffmm] standard_name = Monin_Obukhov_similarity_function_for_momentum long_name = Monin-Obukhov similarity function for momentum units = none - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [zorl] standard_name = surface_roughness_length long_name = surface roughness length units = cm - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [evap] standard_name = surface_upward_specific_humidity_flux long_name = kinematic surface upward latent heat flux units = kg kg-1 m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [evap_fire] standard_name = surface_upward_specific_humidity_flux_of_fire long_name = kinematic surface upward latent heat flux of fire units = kg kg-1 m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [hflx] standard_name = surface_upward_temperature_flux long_name = kinematic surface upward sensible heat flux units = K m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [hflx_fire] standard_name = kinematic_surface_upward_sensible_heat_flux_of_fire long_name = kinematic surface upward sensible heat flux of fire units = K m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [tiice] standard_name = temperature_in_ice_layer long_name = sea ice internal temperature units = K - dimensions = (horizontal_loop_extent,vertical_dimension_of_sea_ice) + dimensions = (horizontal_dimension,vertical_dimension_of_sea_ice) type = real kind = kind_phys [t2m] standard_name = air_temperature_at_2m long_name = 2 meter temperature units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [q2m] standard_name = specific_humidity_at_2m long_name = 2 meter specific humidity units = kg kg-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [f10m] standard_name = ratio_of_wind_at_surface_adjacent_layer_to_wind_at_10m long_name = ratio of sigma level 1 wind and 10m wind units = ratio - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys @@ -1336,21 +1388,21 @@ standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air long_name = thermal exchange coefficient units = kg m-2 s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [cmm] standard_name = surface_drag_wind_speed_for_momentum_in_air long_name = momentum exchange coefficient units = m s-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys [dpt2m] standard_name = dewpoint_temperature_at_2m long_name = 2 meter dewpoint temperature units = K - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_dimension) type = real kind = kind_phys @@ -1358,7 +1410,7 @@ [ccpp-table-properties] name = MED_typedefs type = module - relative_path = ../../../../../FV3/ccpp/physics/physics/hooks + dependencies_path = ../../../../../UFSATM/ccpp/physics/physics/hooks dependencies = machine.F,physcons.F90 [ccpp-arg-table] @@ -1481,4 +1533,3 @@ units = none dimensions = () type = real - diff --git a/ufs/flux_atmocn_ccpp_mod.F90 b/ufs/flux_atmocn_ccpp_mod.F90 index 84f1652bf..bfebc2976 100644 --- a/ufs/flux_atmocn_ccpp_mod.F90 +++ b/ufs/flux_atmocn_ccpp_mod.F90 @@ -137,7 +137,7 @@ subroutine flux_atmOcn_ccpp(gcomp, maintask, logunit, nMax, mask, psfc, pbot, & call physics%statein%create(nMax,physics%model) call physics%stateout%create(nMax) call physics%interstitial%create(nMax) - call physics%coupling%create(nMax) + call physics%coupling%create(nMax,physics%model) call physics%grid%create(nMax) call physics%sfcprop%create(nMax,physics%model) call physics%diag%create(nMax) diff --git a/ufs/flux_atmocn_mod.F90 b/ufs/flux_atmocn_mod.F90 index 3e5b58602..36dc6ceec 100644 --- a/ufs/flux_atmocn_mod.F90 +++ b/ufs/flux_atmocn_mod.F90 @@ -63,7 +63,7 @@ subroutine flux_adjust_constants( flux_convergence_tolerance, & end subroutine flux_adjust_constants !=============================================================================== - subroutine flux_atmOcn(logunit, nMax,zbot ,ubot ,vbot ,thbot , & + subroutine flux_atmOcn(logunit, nMax,zbot ,ubot ,vbot ,thbot , & & qbot , rbot ,tbot ,us ,vs , & & ts , mask ,sen ,lat ,lwup , & & evap , taux ,tauy ,tref ,qref , & @@ -255,11 +255,7 @@ subroutine flux_atmOcn(logunit, nMax,zbot ,ubot ,vbot ,thbot , & !--- shift wind speed using old coefficient --- rd = rdn / (1.0_R8 + rdn/loc_karman*(alz-psimh)) - if (ocn_surface_flux_scheme == -1)then - u10n = vmag - else - u10n = vmag * rd / rdn - end if + u10n = vmag * rd / rdn !--- update transfer coeffs at 10m and neutral stability --- rdn = sqrt(cdn(u10n)) @@ -268,11 +264,7 @@ subroutine flux_atmOcn(logunit, nMax,zbot ,ubot ,vbot ,thbot , & !(1.0_R8-stable) * chxcdu + stable * chxcds !--- shift all coeffs to measurement height and stability --- - if (ocn_surface_flux_scheme == -1)then - rd = rdn - else - rd = rdn / (1.0_R8 + rdn/loc_karman*(alz-psimh)) - end if + rd = rdn / (1.0_R8 + rdn/loc_karman*(alz-psimh)) rh = rhn / (1.0_R8 + rhn/loc_karman*(alz-psixh)) re = ren / (1.0_R8 + ren/loc_karman*(alz-psixh))