From e137a0e5c3ca052244c2d096b75b7e643555b0e3 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 27 Jul 2017 07:34:02 -0600 Subject: [PATCH] remove extra whitespace --- src/drivers/mct/main/CMakeLists.txt | 2 +- src/drivers/mct/main/component_mod.F90 | 92 ++++---- src/drivers/mct/main/component_type_mod.F90 | 24 +-- src/drivers/mct/main/map_glc2lnd_mod.F90 | 2 - src/drivers/mct/main/map_lnd2glc_mod.F90 | 30 +-- src/drivers/mct/main/mrg_mod.F90 | 133 ++++++------ src/drivers/mct/main/prep_aoflux_mod.F90 | 2 - src/drivers/mct/main/prep_atm_mod.F90 | 1 - src/drivers/mct/main/prep_glc_mod.F90 | 14 +- src/drivers/mct/main/prep_ice_mod.F90 | 14 +- src/drivers/mct/main/prep_ocn_mod.F90 | 1 - src/drivers/mct/main/seq_diag_mct.F90 | 42 ++-- src/drivers/mct/main/seq_domain_mct.F90 | 3 - src/drivers/mct/main/seq_flux_mct.F90 | 228 ++++++++++---------- src/drivers/mct/shr/CMakeLists.txt | 2 +- src/drivers/mct/shr/glc_elevclass_mod.F90 | 1 - src/drivers/mct/shr/seq_flds_mod.F90 | 71 +++--- src/drivers/mct/shr/seq_infodata_mod.F90 | 6 +- src/drivers/mct/shr/seq_timemgr_mod.F90 | 206 +++++++++--------- src/drivers/mct/shr/shr_ndep_mod.F90 | 2 +- 20 files changed, 431 insertions(+), 445 deletions(-) diff --git a/src/drivers/mct/main/CMakeLists.txt b/src/drivers/mct/main/CMakeLists.txt index 53cabe62ba2..d18de153ec8 100644 --- a/src/drivers/mct/main/CMakeLists.txt +++ b/src/drivers/mct/main/CMakeLists.txt @@ -6,4 +6,4 @@ list(APPEND drv_sources seq_map_type_mod.F90 ) -sourcelist_to_parent(drv_sources) \ No newline at end of file +sourcelist_to_parent(drv_sources) diff --git a/src/drivers/mct/main/component_mod.F90 b/src/drivers/mct/main/component_mod.F90 index 9d46aa4409f..a88803bef28 100644 --- a/src/drivers/mct/main/component_mod.F90 +++ b/src/drivers/mct/main/component_mod.F90 @@ -3,7 +3,7 @@ module component_mod !---------------------------------------------------------------------------- ! share code & libs !---------------------------------------------------------------------------- - use shr_kind_mod, only: r8 => SHR_KIND_R8 + use shr_kind_mod, only: r8 => SHR_KIND_R8 use shr_kind_mod, only: cs => SHR_KIND_CS use shr_kind_mod, only: cl => SHR_KIND_CL use shr_sys_mod, only: shr_sys_abort, shr_sys_flush @@ -20,11 +20,11 @@ module component_mod use seq_comm_mct, only: seq_comm_iamin, seq_comm_namelen, num_inst_frc use seq_comm_mct, only: seq_comm_suffix, seq_comm_name, seq_comm_setnthreads use seq_comm_mct, only: seq_comm_getinfo => seq_comm_setptrs - use seq_comm_mct, only: seq_comm_petlist + use seq_comm_mct, only: seq_comm_petlist use seq_infodata_mod, only: seq_infodata_putData, seq_infodata_GetData use seq_infodata_mod, only: seq_infodata_exchange, seq_infodata_type - use seq_diag_mct, only: seq_diag_avect_mct - use seq_map_type_mod + use seq_diag_mct, only: seq_diag_avect_mct + use seq_map_type_mod use seq_map_mod use t_drv_timers_mod use component_type_mod @@ -50,7 +50,7 @@ module component_mod public :: component_init_aream public :: component_init_areacor public :: component_run ! mct and esmf versions - public :: component_final ! mct and esmf versions + public :: component_final ! mct and esmf versions public :: component_exch public :: component_diag @@ -61,7 +61,7 @@ module component_mod logical :: iamroot_GLOID, iamroot_CPLID ! GLOID, CPLID masterproc logical :: iamin_CPLID ! true => pe associated with CPLID - integer :: mpicom_GLOID, mpicom_CPLID ! GLOID, CPLID mpi communicator + integer :: mpicom_GLOID, mpicom_CPLID ! GLOID, CPLID mpi communicator integer :: nthreads_GLOID, nthreads_CPLID logical :: drv_threading @@ -101,7 +101,7 @@ subroutine component_init_pre(comp, compid, cplcompid, cplallcompid, & call seq_comm_getinfo(GLOID, mpicom=mpicom_GLOID, iamroot=iamroot_GLOID, nthreads=nthreads_GLOID) call seq_comm_getinfo(CPLID, mpicom=mpicom_CPLID, iamroot=iamroot_CPLID, nthreads=nthreads_CPLID) iamin_CPLID = seq_comm_iamin(CPLID) - + ! Initialize component type variables do eci = 1,size(comp) @@ -127,8 +127,8 @@ subroutine component_init_pre(comp, compid, cplcompid, cplallcompid, & allocate(comp(1)%dom_cx) allocate(comp(1)%gsmap_cx) else - comp(eci)%dom_cx => comp(1)%dom_cx - comp(eci)%gsmap_cx => comp(1)%gsmap_cx + comp(eci)%dom_cx => comp(1)%dom_cx + comp(eci)%gsmap_cx => comp(1)%gsmap_cx end if ! Set cdata_cc - unique for each instance @@ -138,11 +138,11 @@ subroutine component_init_pre(comp, compid, cplcompid, cplallcompid, & comp(eci)%cdata_cc%name = 'cdata_'//ntype(1:1)//ntype(1:1) comp(eci)%cdata_cc%ID = comp(eci)%compid comp(eci)%cdata_cc%mpicom = comp(eci)%mpicom_compid - comp(eci)%cdata_cc%dom => comp(eci)%dom_cc + comp(eci)%cdata_cc%dom => comp(eci)%dom_cc comp(eci)%cdata_cc%gsmap => comp(eci)%gsmap_cc comp(eci)%cdata_cc%infodata => infodata - ! Determine initial value of comp_present in infodata - to do - add this to component + ! Determine initial value of comp_present in infodata - to do - add this to component #ifdef CPRPGI if (comp(1)%oneletterid == 'a') call seq_infodata_getData(infodata, atm_present=comp(eci)%present) @@ -170,7 +170,7 @@ subroutine component_init_cc(Eclock, comp, comp_init, infodata, NLFilename, & ! Arguments type(ESMF_Clock) , intent(inout) :: EClock type(component_type) , intent(inout) :: comp(:) - interface + interface subroutine comp_init( Eclock, cdata, x2c, c2x, nlfilename) use ESMF , only: ESMF_Clock use seq_cdata_mod, only: seq_cdata @@ -179,12 +179,12 @@ subroutine comp_init( Eclock, cdata, x2c, c2x, nlfilename) type(ESMF_Clock), intent(inout) :: EClock type(seq_cdata) , intent(inout) :: cdata type(mct_aVect) , intent(inout) :: x2c - type(mct_aVect) , intent(inout) :: c2x + type(mct_aVect) , intent(inout) :: c2x character(len=*), optional, intent(IN) :: NLFilename ! Namelist filename end subroutine comp_init - end interface + end interface type (seq_infodata_type) , intent(inout) :: infodata - character(len=*) , intent(in) :: NLFilename + character(len=*) , intent(in) :: NLFilename character(len=*) , intent(in), optional :: seq_flds_x2c_fluxes character(len=*) , intent(in), optional :: seq_flds_c2x_fluxes ! @@ -203,7 +203,7 @@ end subroutine comp_init 'cpl2'//comp(1)%ntype(1:3)//'_init') end if - ! The following initializes the component instance cdata_cc (gsmap and dom), + ! The following initializes the component instance cdata_cc (gsmap and dom), ! x2c_cc and c2x_cc do eci = 1,size(comp) @@ -218,7 +218,7 @@ end subroutine comp_init if (comp(eci)%iamin_compid .and. comp(eci)%present) then if (drv_threading) call seq_comm_setnthreads(comp(eci)%nthreads_compid) call shr_sys_flush(logunit) - + if (present(seq_flds_x2c_fluxes)) then call mct_avect_vecmult(comp(eci)%x2c_cc, comp(eci)%drv2mdl, seq_flds_x2c_fluxes, mask_spval=.true.) end if @@ -227,11 +227,11 @@ end subroutine comp_init call comp_init( EClock, comp(eci)%cdata_cc, comp(eci)%x2c_cc, comp(eci)%c2x_cc, & NLFilename=NLFilename ) call t_unset_prefixf() - + if (present(seq_flds_c2x_fluxes)) then call mct_avect_vecmult(comp(eci)%c2x_cc, comp(eci)%mdl2drv, seq_flds_c2x_fluxes, mask_spval=.true.) end if - + if (drv_threading) call seq_comm_setnthreads(nthreads_GLOID) end if end do @@ -243,7 +243,7 @@ end subroutine comp_init ! Determine final value of comp_present in infodata (after component initialization) - do eci = 1,size(comp) + do eci = 1,size(comp) #ifdef CPRPGI if (comp(1)%oneletterid == 'a') call seq_infodata_getData(infodata, atm_present=comp(eci)%present) if (comp(1)%oneletterid == 'l') call seq_infodata_getData(infodata, lnd_present=comp(eci)%present) @@ -279,8 +279,8 @@ end subroutine comp_init end subroutine component_init_cc !=============================================================================== - - subroutine component_init_cx(comp, infodata) + + subroutine component_init_cx(comp, infodata) !--------------------------------------------------------------- ! Uses @@ -330,17 +330,17 @@ subroutine component_init_cx(comp, infodata) endif ! Create mapper_Cc2x and mapper_Cx2c - allocate(comp(eci)%mapper_Cc2x, comp(eci)%mapper_Cx2c) + allocate(comp(eci)%mapper_Cc2x, comp(eci)%mapper_Cx2c) if (iamroot_CPLID) then write(logunit,F0I) 'Initializing mapper_C'//comp(eci)%ntype(1:1)//'2x',eci call shr_sys_flush(logunit) end if - call seq_map_init_exchange(comp(eci), flow='c2x', mapper=comp(eci)%mapper_Cc2x) + call seq_map_init_exchange(comp(eci), flow='c2x', mapper=comp(eci)%mapper_Cc2x) if (iamroot_CPLID) then write(logunit,F0I) 'Initializing mapper_Cx2'//comp(eci)%ntype(1:1),eci call shr_sys_flush(logunit) end if - call seq_map_init_exchange(comp(eci), flow='x2c', mapper=comp(eci)%mapper_Cx2c) + call seq_map_init_exchange(comp(eci), flow='x2c', mapper=comp(eci)%mapper_Cx2c) ! Create x2c_cx and c2x_cx allocate(comp(eci)%x2c_cx, comp(eci)%c2x_cx) @@ -356,7 +356,7 @@ subroutine component_init_cx(comp, infodata) end if call seq_mctext_gGridInit(comp(1)) call seq_map_map_exchange(comp(1), flow='c2x', dom_flag=.true., msgtag=comp(1)%cplcompid*100+1*10+1) - else if (eci > 1) then + else if (eci > 1) then if (iamroot_CPLID) then write(logunit,F0I) 'comparing comp domain ensemble number ',eci call shr_sys_flush(logunit) @@ -419,7 +419,7 @@ subroutine component_init_aream(infodata, rof_c2_ocn, samegrid_ao, samegrid_al, character(*), parameter :: subname = '(component_init_aream)' !--------------------------------------------------------------- - ! Note that the following is assumed to hold - all gsmaps_cx for a given + ! Note that the following is assumed to hold - all gsmaps_cx for a given ! instance of a component (e.g. atm(i)) are identical on the coupler processes mapper_Fa2o => prep_ocn_get_mapper_Fa2o() @@ -460,7 +460,7 @@ subroutine component_init_aream(infodata, rof_c2_ocn, samegrid_ao, samegrid_al, dom_s => component_get_dom_cx(ocn(1)) !dom_ox dom_d => component_get_dom_cx(ice(1)) !dom_ix - call seq_map_map(mapper_SFo2i, av_s=dom_s%data, av_d=dom_d%data, fldlist='aream') + call seq_map_map(mapper_SFo2i, av_s=dom_s%data, av_d=dom_d%data, fldlist='aream') endif if (rof_c2_ocn) then @@ -531,7 +531,7 @@ subroutine component_init_areacor(comp, samegrid, seq_flds_c2x_fluxes) character(*), parameter :: subname = '(component_init_areacor)' !--------------------------------------------------------------- - num_inst = size(comp) + num_inst = size(comp) do eci = 1,num_inst ! For joint cpl-component pes @@ -584,7 +584,7 @@ subroutine component_run(Eclock, comp, comp_run, infodata, & ! Arguments type(ESMF_Clock) , intent(inout) :: EClock type(component_type) , intent(inout) :: comp(:) - interface + interface subroutine comp_run( Eclock, cdata, x2c, c2x) use ESMF, only : ESMF_Clock use seq_cdata_mod, only : seq_cdata @@ -593,19 +593,19 @@ subroutine comp_run( Eclock, cdata, x2c, c2x) type(ESMF_Clock), intent(inout) :: EClock type(seq_cdata) , intent(inout) :: cdata type(mct_aVect) , intent(inout) :: x2c - type(mct_aVect) , intent(inout) :: c2x + type(mct_aVect) , intent(inout) :: c2x end subroutine comp_run - end interface + end interface type (seq_infodata_type) , intent(inout) :: infodata character(len=*) , intent(in), optional :: seq_flds_x2c_fluxes character(len=*) , intent(in), optional :: seq_flds_c2x_fluxes logical , intent(in) :: comp_prognostic integer , intent(in), optional :: comp_num - character(len=*) , intent(in), optional :: timer_barrier + character(len=*) , intent(in), optional :: timer_barrier character(len=*) , intent(in), optional :: timer_comp_run logical , intent(in), optional :: run_barriers integer , intent(in), optional :: ymd ! Current date (YYYYMMDD) - integer , intent(in), optional :: tod ! Current time of day (seconds) + integer , intent(in), optional :: tod ! Current time of day (seconds) character(len=*) , intent(in), optional :: comp_layout ! ! Local Variables @@ -617,7 +617,7 @@ end subroutine comp_run real(r8) :: cktime ! delta time real(r8) :: cktime_acc(10) ! cktime accumulator array 1 = all, 2 = atm, etc integer :: cktime_cnt(10) ! cktime counter array - logical :: seq_multi_inst ! a special case of running multiinstances on the same pes. + logical :: seq_multi_inst ! a special case of running multiinstances on the same pes. integer :: phase, phasemin, phasemax ! phase support logical :: firstloop ! first time around phase loop character(*), parameter :: subname = '(component_run:mct)' @@ -661,7 +661,7 @@ end subroutine comp_run if (present(run_barriers)) then if (run_barriers) then call t_drvstartf (trim(timer_barrier)) - call mpi_barrier(comp(eci)%mpicom_compid, ierr) + call mpi_barrier(comp(eci)%mpicom_compid, ierr) call t_drvstopf (trim(timer_barrier)) time_brun = mpi_wtime() endif @@ -671,7 +671,7 @@ end subroutine comp_run if (present(timer_comp_run)) then call t_drvstartf (trim(timer_comp_run), barrier=comp(eci)%mpicom_compid) end if - if (drv_threading) call seq_comm_setnthreads(comp(1)%nthreads_compid) + if (drv_threading) call seq_comm_setnthreads(comp(1)%nthreads_compid) if (comp_prognostic .and. firstloop .and. present(seq_flds_x2c_fluxes)) then call mct_avect_vecmult(comp(eci)%x2c_cc, comp(eci)%drv2mdl, seq_flds_x2c_fluxes, mask_spval=.true.) @@ -737,9 +737,9 @@ subroutine comp_final( Eclock, cdata, x2c, c2x) type(ESMF_Clock), intent(inout) :: EClock type(seq_cdata) , intent(inout) :: cdata type(mct_aVect) , intent(inout) :: x2c - type(mct_aVect) , intent(inout) :: c2x + type(mct_aVect) , intent(inout) :: c2x end subroutine comp_final - end interface + end interface ! ! Local Variables integer :: eci @@ -750,25 +750,25 @@ end subroutine comp_final num_inst = size(comp) do eci = 1,num_inst if (comp(eci)%iamin_compid) then - if (drv_threading) call seq_comm_setnthreads(comp(1)%nthreads_compid) + if (drv_threading) call seq_comm_setnthreads(comp(1)%nthreads_compid) call t_set_prefixf(comp(1)%oneletterid//"_f:") call comp_final(EClock, comp(eci)%cdata_cc, comp(eci)%x2c_cc, comp(eci)%c2x_cc) call t_unset_prefixf() if (drv_threading) call seq_comm_setnthreads(nthreads_GLOID) end if end do - + end subroutine component_final !=============================================================================== subroutine component_exch(comp, flow, infodata, infodata_string, & mpicom_barrier, run_barriers, & - timer_barrier, timer_comp_exch, timer_map_exch, timer_infodata_exch) + timer_barrier, timer_comp_exch, timer_map_exch, timer_infodata_exch) !--------------------------------------------------------------- ! Description - ! Map x2m_mx to x2m_mm (component input av from + ! Map x2m_mx to x2m_mm (component input av from ! coupler processes to component model processes) ! ! Arguments @@ -842,7 +842,7 @@ subroutine component_exch(comp, flow, infodata, infodata_string, & if (present(timer_comp_exch)) then if (present(mpicom_barrier)) then - call t_drvstopf (trim(timer_comp_exch), cplcom=.true.) + call t_drvstopf (trim(timer_comp_exch), cplcom=.true.) end if end if @@ -850,7 +850,7 @@ end subroutine component_exch !=============================================================================== - subroutine component_diag(infodata, comp, flow, comment, info_debug, timer_diag ) + subroutine component_diag(infodata, comp, flow, comment, info_debug, timer_diag ) !--------------------------------------------------------------- ! Description @@ -859,7 +859,7 @@ subroutine component_diag(infodata, comp, flow, comment, info_debug, timer_diag ! Arguments type (seq_infodata_type) , intent(inout) :: infodata type(component_type) , intent(in) :: comp(:) - character(len=3) , intent(in) :: flow + character(len=3) , intent(in) :: flow character(len=*) , intent(in) :: comment integer , intent(in) :: info_debug character(len=*) , intent(in), optional :: timer_diag diff --git a/src/drivers/mct/main/component_type_mod.F90 b/src/drivers/mct/main/component_type_mod.F90 index 3f31d26bfaf..7317442ad26 100644 --- a/src/drivers/mct/main/component_type_mod.F90 +++ b/src/drivers/mct/main/component_type_mod.F90 @@ -3,7 +3,7 @@ module component_type_mod !---------------------------------------------------------------------------- ! share code & libs !---------------------------------------------------------------------------- - use shr_kind_mod , only: r8 => SHR_KIND_R8 + use shr_kind_mod , only: r8 => SHR_KIND_R8 use shr_kind_mod , only: cs => SHR_KIND_CS use shr_kind_mod , only: cl => SHR_KIND_CL use seq_cdata_mod , only: seq_cdata @@ -12,7 +12,7 @@ module component_type_mod use seq_comm_mct , only: num_inst_atm, num_inst_lnd, num_inst_rof use seq_comm_mct , only: num_inst_ocn, num_inst_ice, num_inst_glc use seq_comm_mct , only: num_inst_wav, num_inst_esp - use mct_mod + use mct_mod implicit none save @@ -39,7 +39,7 @@ module component_type_mod public :: component_get_mdl2drv ! ! on union coupler/component pes - public :: component_get_mapper_Cc2x + public :: component_get_mapper_Cc2x public :: component_get_mapper_Cx2c ! ! on driver pes (all pes) @@ -53,12 +53,12 @@ module component_type_mod type component_type ! - ! Coupler pes + ! Coupler pes ! used by prep_xxx and all other coupler based routines ! type(mct_ggrid) , pointer :: dom_cx => null() ! component domain (same for all instances) type(mct_gsMap) , pointer :: gsMap_cx => null() ! decomposition on coupler pes (same for all instances) - type(mct_aVect) , pointer :: x2c_cx => null() ! + type(mct_aVect) , pointer :: x2c_cx => null() ! type(mct_aVect) , pointer :: c2x_cx => null() ! ! Component pes @@ -80,7 +80,7 @@ module component_type_mod ! integer :: compid integer :: cplcompid - integer :: cplallcompid + integer :: cplallcompid integer :: mpicom_compid integer :: mpicom_cplcompid integer :: mpicom_cplallcompid @@ -195,35 +195,33 @@ function component_get_gsmap_cc(comp) end function component_get_gsmap_cc function component_get_cdata_cc(comp) - type(component_type), intent(in), target :: comp + type(component_type), intent(in), target :: comp type(seq_cdata), pointer :: component_get_cdata_cc component_get_cdata_cc => comp%cdata_cc end function component_get_cdata_cc function component_get_drv2mdl(comp) - type(component_type), intent(in), target :: comp + type(component_type), intent(in), target :: comp real(r8), pointer :: component_get_drv2mdl(:) component_get_drv2mdl => comp%drv2mdl end function component_get_drv2mdl function component_get_mdl2drv(comp) - type(component_type), intent(in), target :: comp + type(component_type), intent(in), target :: comp real(r8), pointer :: component_get_mdl2drv(:) component_get_mdl2drv => comp%mdl2drv end function component_get_mdl2drv function component_get_mapper_Cc2x(comp) - type(component_type), intent(in), target :: comp + type(component_type), intent(in), target :: comp type(seq_map), pointer :: component_get_mapper_Cc2x component_get_mapper_Cc2x => comp%mapper_Cc2x end function component_get_mapper_Cc2x function component_get_mapper_Cx2c(comp) - type(component_type), intent(in), target :: comp + type(component_type), intent(in), target :: comp type(seq_map), pointer :: component_get_mapper_Cx2c component_get_mapper_Cx2c => comp%mapper_Cx2c end function component_get_mapper_Cx2c end module component_type_mod - - diff --git a/src/drivers/mct/main/map_glc2lnd_mod.F90 b/src/drivers/mct/main/map_glc2lnd_mod.F90 index 9bb67b1de57..c95649176ba 100644 --- a/src/drivers/mct/main/map_glc2lnd_mod.F90 +++ b/src/drivers/mct/main/map_glc2lnd_mod.F90 @@ -398,5 +398,3 @@ subroutine make_aVect_frac_times_icemask(frac_av, mask_av, frac_field, icemask_f end subroutine make_aVect_frac_times_icemask end module map_glc2lnd_mod - - diff --git a/src/drivers/mct/main/map_lnd2glc_mod.F90 b/src/drivers/mct/main/map_lnd2glc_mod.F90 index 94c2bb899a7..1c764691efc 100644 --- a/src/drivers/mct/main/map_lnd2glc_mod.F90 +++ b/src/drivers/mct/main/map_lnd2glc_mod.F90 @@ -313,7 +313,7 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, & ! ! Puts the output in data_g_ice_covered, which should already be allocated to have size ! equal to the number of GLC points that this processor is responsible for. - ! + ! ! !USES: ! ! !ARGUMENTS: @@ -323,7 +323,7 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, & real(r8) , intent(in) :: topo_g(:) ! topographic height for each point on the glc grid type(seq_map) , intent(inout) :: mapper real(r8) , intent(out) :: data_g_ice_covered(:) ! field remapped to glc grid - + ! !LOCAL VARIABLES: character(len=*), parameter :: toponame = 'Sl_topo' ! base name for topo fields in l2x_l; @@ -336,7 +336,7 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, & character(len=:), allocatable :: fieldnamelist character(len=:), allocatable :: toponamelist character(len=:), allocatable :: totalfieldlist - + integer :: nEC ! number of elevation classes integer :: lsize_g ! number of cells on glc grid integer :: n, ec @@ -361,15 +361,15 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, & lsize_g = size(data_g_ice_covered) nEC = glc_get_num_elevation_classes() SHR_ASSERT_FL((size(topo_g) == lsize_g), __FILE__, __LINE__) - + ! ------------------------------------------------------------------------ ! Create temporary vectors ! ------------------------------------------------------------------------ - + allocate(tmp_field_g(lsize_g)) allocate(data_g_EC (lsize_g,nEC)) allocate(topo_g_EC (lsize_g,nEC)) - + ! ------------------------------------------------------------------------ ! Make a string that concatenates all EC levels of field, as well as the topo ! The resulting list will look something like this: @@ -387,14 +387,14 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, & strlen = len_trim(fieldnamelist) + len_trim(toponamelist) + extra_len_for_list_merge allocate(character(len=strlen) :: totalfieldlist) call shr_string_listMerge(fieldnamelist, toponamelist, totalfieldlist ) - + ! ------------------------------------------------------------------------ ! Make a temporary attribute vector. ! For each grid cell on the land grid, this attribute vector contains the field and ! topo values for all ECs. ! ------------------------------------------------------------------------ call mct_aVect_init(l2x_g_temp, rList = totalfieldlist, lsize = lsize_g) - + ! ------------------------------------------------------------------------ ! Remap all these fields from the land (source) grid to the glc (destination) grid. ! ------------------------------------------------------------------------ @@ -406,7 +406,7 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, & norm = .true., & avwts_s = landfrac_l, & avwtsfld_s = 'lfrac') - + ! ------------------------------------------------------------------------ ! Export all elevation classes out of attribute vector and into local 2D arrays (xy,z) ! ------------------------------------------------------------------------ @@ -420,13 +420,13 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, & call mct_aVect_exportRattr(l2x_g_temp, toponame_ec, tmp_field_g) topo_g_EC(:,ec) = tmp_field_g enddo - + ! ------------------------------------------------------------------------ ! Perform vertical interpolation of data onto ice sheet topography ! ------------------------------------------------------------------------ - + data_g_ice_covered(:) = 0._r8 - + do n = 1, lsize_g ! For each ice sheet point, find bounding EC values... @@ -465,7 +465,7 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, & end do end if ! topo_g(n) end do ! lsize_g - + ! ------------------------------------------------------------------------ ! Clean up ! ------------------------------------------------------------------------ @@ -473,9 +473,9 @@ subroutine map_ice_covered(l2x_l, landfrac_l, fieldname, & deallocate(tmp_field_g) deallocate(data_g_EC) deallocate(topo_g_EC) - + call mct_aVect_clean(l2x_g_temp) - + end subroutine map_ice_covered end module map_lnd2glc_mod diff --git a/src/drivers/mct/main/mrg_mod.F90 b/src/drivers/mct/main/mrg_mod.F90 index 40bfd3daa5b..aa4f2c52042 100644 --- a/src/drivers/mct/main/mrg_mod.F90 +++ b/src/drivers/mct/main/mrg_mod.F90 @@ -10,7 +10,7 @@ module mrg_mod private ! except !-------------------------------------------------------------------------- -! TODO - write summary of naming convention here as well +! TODO - write summary of naming convention here as well !-------------------------------------------------------------------------- @@ -31,7 +31,7 @@ module mrg_mod ! Private interfaces !-------------------------------------------------------------------------- - private :: getfld + private :: getfld !-------------------------------------------------------------------------- ! Private data @@ -43,7 +43,7 @@ module mrg_mod subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2a_a ) - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- ! ! Arguments ! @@ -54,13 +54,13 @@ subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2 type(mct_aVect), intent(in) :: i2x_a type(mct_aVect), intent(in) :: fractions_a type(mct_aVect), intent(inout) :: x2a_a - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- ! ! Local workspace ! real(r8) :: fracl, fraci, fraco integer :: n,ka,ki,kl,ko,kx,kof,kif,klf - integer :: lsize + integer :: lsize integer :: index_x2a_Sf_lfrac integer :: index_x2a_Sf_ifrac integer :: index_x2a_Sf_ofrac @@ -74,7 +74,7 @@ subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2 character(CL) :: itemc_ice ! string converted to char character(CL) :: itemc_xao ! string converted to char character(CL) :: itemc_ocn ! string converted to char - logical :: iamroot + logical :: iamroot logical :: first_time = .true. logical, pointer, save :: lmerge(:),imerge(:),xmerge(:),omerge(:) integer, pointer, save :: lindx(:), iindx(:), oindx(:),xindx(:) @@ -84,7 +84,7 @@ subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2 call seq_comm_setptrs(CPLID, iamroot=iamroot) if (first_time) then - + naflds = mct_aVect_nRattr(x2a_a) klflds = mct_aVect_nRattr(l2x_a) niflds = mct_aVect_nRattr(i2x_a) @@ -107,13 +107,13 @@ subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2 ! Field naming rules ! Only atm states that are Sx_... will be merged - ! Only fluxes that are F??x_... will be merged + ! Only fluxes that are F??x_... will be merged ! All fluxes will be multiplied by corresponding component fraction do ka = 1,naflds call getfld(ka, x2a_a, field_atm, itemc_atm) if (field_atm(1:2) == 'PF') then - cycle ! if flux has first character as P, pass straight through + cycle ! if flux has first character as P, pass straight through end if if (field_atm(1:1) == 'S' .and. field_atm(2:2) /= 'x') then cycle ! any state fields that are not Sx_ will just be copied @@ -126,7 +126,7 @@ subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2 if (field_lnd(1:1) == 'F') lmerge(ka) = .false. end if lindx(ka) = kl - exit + exit end if end do do ki = 1,niflds @@ -139,7 +139,7 @@ subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2 if (field_ice(1:1) == 'F') imerge(ka) = .false. end if iindx(ka) = ki - exit + exit end if end do do kx = 1,nxflds @@ -149,7 +149,7 @@ subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2 if (field_xao(1:1) == 'F') xmerge(ka) = .false. end if xindx(ka) = kx - exit + exit end if end do do ko = 1,noflds @@ -159,7 +159,7 @@ subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2 if (field_ocn(1:1) == 'F') omerge(ka) = .false. end if oindx(ka) = ko - exit + exit end if end do if (lindx(ka) == 0) itemc_lnd = 'unset' @@ -200,33 +200,33 @@ subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2 end do ! Copy attributes that do not need to be merged - ! These are assumed to have the same name in + ! These are assumed to have the same name in ! (o2x_a and x2a_a) and in (l2x_a and x2a_a), etc. call mct_aVect_copy(aVin=l2x_a, aVout=x2a_a, vector=mct_usevector) call mct_aVect_copy(aVin=o2x_a, aVout=x2a_a, vector=mct_usevector) - call mct_aVect_copy(aVin=i2x_a, aVout=x2a_a, vector=mct_usevector) + call mct_aVect_copy(aVin=i2x_a, aVout=x2a_a, vector=mct_usevector) call mct_aVect_copy(aVin=xao_a, aVout=x2a_a, vector=mct_usevector) - ! If flux to atm is coming only from the ocean (based on field being in o2x_a) - + ! If flux to atm is coming only from the ocean (based on field being in o2x_a) - ! -- then scale by both ocean and ice fraction ! If flux to atm is coming only from the land or ice or coupler ! -- then do scale by fraction above - + do ka = 1,naflds do n = 1,lsize fracl = fractions_a%Rattr(klf,n) fraci = fractions_a%Rattr(kif,n) fraco = fractions_a%Rattr(kof,n) if (lindx(ka) > 0 .and. fracl > 0._r8) then - if (lmerge(ka)) then + if (lmerge(ka)) then x2a_a%rAttr(ka,n) = x2a_a%rAttr(ka,n) + l2x_a%rAttr(lindx(ka),n) * fracl else x2a_a%rAttr(ka,n) = l2x_a%rAttr(lindx(ka),n) * fracl end if end if if (iindx(ka) > 0 .and. fraci > 0._r8) then - if (imerge(ka)) then + if (imerge(ka)) then x2a_a%rAttr(ka,n) = x2a_a%rAttr(ka,n) + i2x_a%rAttr(iindx(ka),n) * fraci else x2a_a%rAttr(ka,n) = i2x_a%rAttr(iindx(ka),n) * fraci @@ -246,7 +246,7 @@ subroutine mrg_x2a_run_mct( cdata_a, l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2 if (.not. omerge(ka)) then !--- NOTE: This IS using the ocean fields and ice fraction !! --- x2a_a%rAttr(ka,n) = o2x_a%rAttr(oindx(ka),n) * fraci - x2a_a%rAttr(ka,n) = x2a_a%rAttr(ka,n) + o2x_a%rAttr(oindx(ka),n) * fraco + x2a_a%rAttr(ka,n) = x2a_a%rAttr(ka,n) + o2x_a%rAttr(oindx(ka),n) * fraco end if end if end do @@ -258,7 +258,7 @@ end subroutine mrg_x2a_run_mct subroutine mrg_x2i_run_mct( cdata_i, a2x_i, o2x_i, x2i_i ) - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- ! ! Arguments ! @@ -293,7 +293,7 @@ subroutine mrg_x2i_run_mct( cdata_i, a2x_i, o2x_i, x2i_i ) integer, save :: index_a2x_Faxa_rainl_18O integer, save :: index_a2x_Faxa_snowc_18O integer, save :: index_a2x_Faxa_snowl_18O - integer, save :: index_x2i_Faxa_rain_18O + integer, save :: index_x2i_Faxa_rain_18O integer, save :: index_x2i_Faxa_snow_18O integer, save :: index_a2x_Faxa_rainc_HDO integer, save :: index_a2x_Faxa_rainl_HDO @@ -302,7 +302,7 @@ subroutine mrg_x2i_run_mct( cdata_i, a2x_i, o2x_i, x2i_i ) integer, save :: index_x2i_Faxa_rain_HDO integer, save :: index_x2i_Faxa_snow_HDO - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- if (first_time) then index_a2x_Faxa_snowc = mct_aVect_indexRA(a2x_i,'Faxa_snowc') @@ -348,13 +348,13 @@ subroutine mrg_x2i_run_mct( cdata_i, a2x_i, o2x_i, x2i_i ) call mct_aVect_copy(aVin=a2x_i, aVout=x2i_i, vector=mct_usevector) ! Merge total snow and precip for ice input - ! Scale total precip and runoff by flux_epbalfact + ! Scale total precip and runoff by flux_epbalfact do i = 1,mct_aVect_lsize(x2i_i) x2i_i%rAttr(index_x2i_Faxa_rain,i) = a2x_i%rAttr(index_a2x_Faxa_rainc,i) + & a2x_i%rAttr(index_a2x_Faxa_rainl,i) x2i_i%rAttr(index_x2i_Faxa_snow,i) = a2x_i%rAttr(index_a2x_Faxa_snowc,i) + & - a2x_i%rAttr(index_a2x_Faxa_snowl,i) + a2x_i%rAttr(index_a2x_Faxa_snowl,i) x2i_i%rAttr(index_x2i_Faxa_rain,i) = x2i_i%rAttr(index_x2i_Faxa_rain,i) * flux_epbalfact x2i_i%rAttr(index_x2i_Faxa_snow,i) = x2i_i%rAttr(index_x2i_Faxa_snow,i) * flux_epbalfact @@ -366,17 +366,17 @@ subroutine mrg_x2i_run_mct( cdata_i, a2x_i, o2x_i, x2i_i ) x2i_i%rAttr(index_x2i_Faxa_rain_16O,i) = a2x_i%rAttr(index_a2x_Faxa_rainc_16O,i) + & a2x_i%rAttr(index_a2x_Faxa_rainl_16O,i) x2i_i%rAttr(index_x2i_Faxa_snow_16O,i) = a2x_i%rAttr(index_a2x_Faxa_snowc_16O,i) + & - a2x_i%rAttr(index_a2x_Faxa_snowl_16O,i) + a2x_i%rAttr(index_a2x_Faxa_snowl_16O,i) !H2_18O x2i_i%rAttr(index_x2i_Faxa_rain_18O,i) = a2x_i%rAttr(index_a2x_Faxa_rainc_18O,i) + & a2x_i%rAttr(index_a2x_Faxa_rainl_18O,i) x2i_i%rAttr(index_x2i_Faxa_snow_18O,i) = a2x_i%rAttr(index_a2x_Faxa_snowc_18O,i) + & - a2x_i%rAttr(index_a2x_Faxa_snowl_18O,i) + a2x_i%rAttr(index_a2x_Faxa_snowl_18O,i) !HDO x2i_i%rAttr(index_x2i_Faxa_rain_HDO,i) = a2x_i%rAttr(index_a2x_Faxa_rainc_HDO,i) + & a2x_i%rAttr(index_a2x_Faxa_rainl_HDO,i) x2i_i%rAttr(index_x2i_Faxa_snow_HDO,i) = a2x_i%rAttr(index_a2x_Faxa_snowc_HDO,i) + & - a2x_i%rAttr(index_a2x_Faxa_snowl_HDO,i) + a2x_i%rAttr(index_a2x_Faxa_snowl_HDO,i) x2i_i%rAttr(index_x2i_Faxa_rain_16O,i) = x2i_i%rAttr(index_x2i_Faxa_rain_16O,i) * flux_epbalfact x2i_i%rAttr(index_x2i_Faxa_snow_16O,i) = x2i_i%rAttr(index_x2i_Faxa_snow_16O,i) * flux_epbalfact @@ -394,7 +394,7 @@ end subroutine mrg_x2i_run_mct subroutine mrg_x2r_run_mct( cdata_r, l2x_r, fractions_r, x2r_r) - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- ! ! Arguments ! @@ -427,7 +427,7 @@ subroutine mrg_x2r_run_mct( cdata_r, l2x_r, fractions_r, x2r_r) logical, save :: first_time = .true. logical, save :: flds_wiso = .false. real(r8) :: lfrac - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- if (first_time) then index_l2x_Flrl_rofliq = mct_aVect_indexRA(l2x_r,'Flrl_rofliq' ) @@ -478,16 +478,16 @@ end subroutine mrg_x2r_run_mct subroutine mrg_x2l_run_mct( cdata_l, a2x_l, r2l_l, x2l_l ) - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- ! Arguments ! type(seq_cdata), intent(in) :: cdata_l type(mct_aVect), intent(in) :: a2x_l ! input type(mct_aVect), intent(in) :: r2l_l ! input type(mct_aVect), intent(inout) :: x2l_l ! output - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- - ! Create input land state directly from atm and runoff outputs + ! Create input land state directly from atm and runoff outputs call mct_aVect_copy(aVin=a2x_l, aVout=x2l_l, vector=mct_usevector) call mct_aVect_copy(aVin=r2l_l, aVout=x2l_l, vector=mct_usevector) @@ -497,7 +497,7 @@ end subroutine mrg_x2l_run_mct subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2o_o ) - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- ! Arguments type(seq_cdata), intent(in) :: cdata_o type(mct_aVect), intent(in) :: a2x_o @@ -528,7 +528,7 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 character(CL) :: itemc_atm ! string converted to char character(CL) :: itemc_ice ! string converted to char character(CL) :: itemc_xao ! string converted to char - logical :: iamroot + logical :: iamroot type(seq_infodata_type),pointer :: infodata integer, save :: index_a2x_Faxa_swvdr integer, save :: index_a2x_Faxa_swvdf @@ -544,9 +544,9 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 integer, save :: index_a2x_Faxa_rainc integer, save :: index_a2x_Faxa_rainl integer, save :: index_x2o_Foxx_swnet - integer, save :: index_x2o_Faxa_snow - integer, save :: index_x2o_Faxa_rain - integer, save :: index_x2o_Faxa_prec + integer, save :: index_x2o_Faxa_snow + integer, save :: index_x2o_Faxa_rain + integer, save :: index_x2o_Faxa_prec !wiso fields: integer, save :: index_a2x_Faxa_rainc_16O @@ -576,7 +576,7 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 logical, save :: first_time = .true. logical, save :: flds_wiso = .false. character(*),parameter :: subName = '(mrg_x2o_run_mct) ' - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- call seq_comm_setptrs(CPLID, iamroot=iamroot) @@ -590,7 +590,7 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 index_a2x_Faxa_swvdf = mct_aVect_indexRA(a2x_o,'Faxa_swvdf') index_a2x_Faxa_swndr = mct_aVect_indexRA(a2x_o,'Faxa_swndr') index_a2x_Faxa_swndf = mct_aVect_indexRA(a2x_o,'Faxa_swndf') - index_i2x_Fioi_swpen = mct_aVect_indexRA(i2x_o,'Fioi_swpen') + index_i2x_Fioi_swpen = mct_aVect_indexRA(i2x_o,'Fioi_swpen') index_xao_So_avsdr = mct_aVect_indexRA(xao_o,'So_avsdr') index_xao_So_anidr = mct_aVect_indexRA(xao_o,'So_anidr') index_xao_So_avsdf = mct_aVect_indexRA(xao_o,'So_avsdf') @@ -603,7 +603,7 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 index_a2x_Faxa_rainl = mct_aVect_indexRA(a2x_o,'Faxa_rainl') index_x2o_Faxa_snow = mct_aVect_indexRA(x2o_o,'Faxa_snow') index_x2o_Faxa_rain = mct_aVect_indexRA(x2o_o,'Faxa_rain') - index_x2o_Faxa_prec = mct_aVect_indexRA(x2o_o,'Faxa_prec') + index_x2o_Faxa_prec = mct_aVect_indexRA(x2o_o,'Faxa_prec') !wiso: ! H2_16O @@ -634,17 +634,17 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 index_x2o_Faxa_prec_HDO = mct_aVect_indexRA(x2o_o,'Faxa_prec_HDO' , perrWith='quiet') if ( index_x2o_Faxa_rain_HDO /= 0 ) flds_wiso = .true. - + ! Compute all other quantities based on standardized naming convention (see below) ! Only ocn field states that have the name-prefix Sx_ will be merged ! Only field names have the same name-suffix (after the "_") will be merged ! (e.g. Si_fldname, Sa_fldname => merged to => Sx_fldname) - ! All fluxes will be scaled by the corresponding afrac or ifrac - ! EXCEPT for + ! All fluxes will be scaled by the corresponding afrac or ifrac + ! EXCEPT for ! -- Faxa_snnet, Faxa_snow, Faxa_rain, Faxa_prec (derived) ! -- Forr_* (treated in ccsm_comp_mod) - ! All i2x_o fluxes that have the name-suffix "Faii" (atm/ice fluxes) will be ignored + ! All i2x_o fluxes that have the name-suffix "Faii" (atm/ice fluxes) will be ignored ! - only ice fluxes that are Fioi_... will be used in the ocean merges allocate(aindx(noflds), amerge(noflds)) @@ -660,10 +660,10 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 do kof = 1,noflds call getfld(kof, x2o_o, field_ocn, itemc_ocn) if (field_ocn(1:2) == 'PF') then - cycle ! if flux has first character as P, pass straight through + cycle ! if flux has first character as P, pass straight through end if if (field_ocn(1:1) == 'S' .and. field_ocn(2:2) /= 'x') then - cycle ! ignore all ocn states that do not have a Sx_ prefix + cycle ! ignore all ocn states that do not have a Sx_ prefix end if if (trim(field_ocn) == 'Foxx_swnet'.or. & trim(field_ocn) == 'Faxa_snow' .or. & @@ -730,13 +730,13 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 10 format(' ',' ocn field: ',a15,', xao merge: ',a15, & ', ice merge: ',a15,', atm merge: ',a15) write(logunit, *)'field_ocn,kof,imerge,amerge,xmerge= ',& - trim(field_ocn),kof,imerge(kof),xmerge(kof),amerge(kof) + trim(field_ocn),kof,imerge(kof),xmerge(kof),amerge(kof) end if end do first_time = .false. end if - + call seq_cdata_setptrs(cdata_o, infodata=infodata) call seq_infodata_GetData(infodata, flux_epbalfact = flux_epbalfact) @@ -773,10 +773,10 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 endif ! Derived: compute net short-wave - avsdr = xao_o%rAttr(index_xao_So_avsdr,n) - anidr = xao_o%rAttr(index_xao_So_anidr,n) - avsdf = xao_o%rAttr(index_xao_So_avsdf,n) - anidf = xao_o%rAttr(index_xao_So_anidf,n) + avsdr = xao_o%rAttr(index_xao_So_avsdr,n) + anidr = xao_o%rAttr(index_xao_So_anidr,n) + avsdf = xao_o%rAttr(index_xao_So_avsdf,n) + anidf = xao_o%rAttr(index_xao_So_anidf,n) fswabsv = a2x_o%rAttr(index_a2x_Faxa_swvdr,n) * (1.0_R8 - avsdr) & + a2x_o%rAttr(index_a2x_Faxa_swvdf,n) * (1.0_R8 - avsdf) fswabsi = a2x_o%rAttr(index_a2x_Faxa_swndr,n) * (1.0_R8 - anidr) & @@ -784,10 +784,10 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 x2o_o%rAttr(index_x2o_Foxx_swnet,n) = (fswabsv + fswabsi) * afracr + & i2x_o%rAttr(index_i2x_Fioi_swpen,n) * ifrac - ! Derived: compute total precipitation - scale total precip + ! Derived: compute total precipitation - scale total precip ! Note that runoff is scaled by flux_epbalfact in ccsm_comp_mod x2o_o%rAttr(index_x2o_Faxa_snow ,n) = a2x_o%rAttr(index_a2x_Faxa_snowc,n) * afrac + & - a2x_o%rAttr(index_a2x_Faxa_snowl,n) * afrac + a2x_o%rAttr(index_a2x_Faxa_snowl,n) * afrac x2o_o%rAttr(index_x2o_Faxa_rain ,n) = a2x_o%rAttr(index_a2x_Faxa_rainc,n) * afrac + & a2x_o%rAttr(index_a2x_Faxa_rainl,n) * afrac @@ -800,15 +800,15 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 !wiso if ( flds_wiso )then x2o_o%rAttr(index_x2o_Faxa_snow_16O ,n) = a2x_o%rAttr(index_a2x_Faxa_snowc_16O,n) * afrac + & - a2x_o%rAttr(index_a2x_Faxa_snowl_16O,n) * afrac + a2x_o%rAttr(index_a2x_Faxa_snowl_16O,n) * afrac x2o_o%rAttr(index_x2o_Faxa_rain_16O ,n) = a2x_o%rAttr(index_a2x_Faxa_rainc_16O,n) * afrac + & a2x_o%rAttr(index_a2x_Faxa_rainl_16O,n) * afrac x2o_o%rAttr(index_x2o_Faxa_snow_18O ,n) = a2x_o%rAttr(index_a2x_Faxa_snowc_18O,n) * afrac + & - a2x_o%rAttr(index_a2x_Faxa_snowl_18O,n) * afrac + a2x_o%rAttr(index_a2x_Faxa_snowl_18O,n) * afrac x2o_o%rAttr(index_x2o_Faxa_rain_18O ,n) = a2x_o%rAttr(index_a2x_Faxa_rainc_18O,n) * afrac + & a2x_o%rAttr(index_a2x_Faxa_rainl_18O,n) * afrac x2o_o%rAttr(index_x2o_Faxa_snow_HDO ,n) = a2x_o%rAttr(index_a2x_Faxa_snowc_HDO,n) * afrac + & - a2x_o%rAttr(index_a2x_Faxa_snowl_HDO,n) * afrac + a2x_o%rAttr(index_a2x_Faxa_snowl_HDO,n) * afrac x2o_o%rAttr(index_x2o_Faxa_rain_HDO ,n) = a2x_o%rAttr(index_a2x_Faxa_rainc_HDO,n) * afrac + & a2x_o%rAttr(index_a2x_Faxa_rainl_HDO,n) * afrac @@ -839,7 +839,7 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 afrac = afrac / (frac_sum) endif if (iindx(kof) > 0) then - if (imerge(kof)) then + if (imerge(kof)) then x2o_o%rAttr(kof,n) = x2o_o%rAttr(kof,n) + i2x_o%rAttr(iindx(kof),n) * ifrac else x2o_o%rAttr(kof,n) = i2x_o%rAttr(iindx(kof),n) * ifrac @@ -861,20 +861,20 @@ subroutine mrg_x2o_run_mct( cdata_o, a2x_o, i2x_o, w2x_o, xao_o, fractions_o, x2 end if end do end do - + end subroutine mrg_x2o_run_mct !-------------------------------------------------------------------------- subroutine mrg_x2g_run_mct( cdata_g, s2x_g, x2g_g ) - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- ! Arguments ! type(seq_cdata), intent(in) :: cdata_g type(mct_aVect), intent(inout) :: s2x_g ! input type(mct_aVect), intent(inout) :: x2g_g ! output - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- ! Create input glc state directly from land snow output state call mct_aVect_copy(aVin=s2x_g, aVout=x2g_g, vector=mct_usevector) @@ -885,13 +885,13 @@ end subroutine mrg_x2g_run_mct subroutine mrg_x2s_run_mct( cdata_s, g2x_s, x2s_s ) - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- ! Arguments ! type(seq_cdata), intent(in) :: cdata_s type(mct_aVect), intent(inout) :: g2x_s ! input type(mct_aVect), intent(inout) :: x2s_s ! output - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- ! Create input land state directly from glc output state call mct_aVect_copy(aVin=g2x_s, aVout=x2s_s, vector=mct_usevector) @@ -925,7 +925,7 @@ end subroutine mrg_x2w_run_mct subroutine getfld(n, av, field, suffix) integer , intent(in) :: n - type(mct_aVect) , intent(in) :: av + type(mct_aVect) , intent(in) :: av character(len=*), intent(out) :: field character(len=*), intent(out) :: suffix @@ -937,10 +937,9 @@ subroutine getfld(n, av, field, suffix) call mct_string_clean(mstring) if (field(1:1) /= 'S' .and. field(1:1) /= 'F' .and. field(1:2) /= 'PF') then - write(6,*)'field attribute',trim(field),' must start with S or F or PF' + write(6,*)'field attribute',trim(field),' must start with S or F or PF' call shr_sys_abort() end if end subroutine getfld end module mrg_mod - diff --git a/src/drivers/mct/main/prep_aoflux_mod.F90 b/src/drivers/mct/main/prep_aoflux_mod.F90 index 1b62be6508a..2c0917da22d 100644 --- a/src/drivers/mct/main/prep_aoflux_mod.F90 +++ b/src/drivers/mct/main/prep_aoflux_mod.F90 @@ -211,5 +211,3 @@ function prep_aoflux_get_xao_ax() end function prep_aoflux_get_xao_ax end module prep_aoflux_mod - - diff --git a/src/drivers/mct/main/prep_atm_mod.F90 b/src/drivers/mct/main/prep_atm_mod.F90 index 72746e7ae8b..c4836f34407 100644 --- a/src/drivers/mct/main/prep_atm_mod.F90 +++ b/src/drivers/mct/main/prep_atm_mod.F90 @@ -788,4 +788,3 @@ end function prep_atm_get_mapper_Fi2a !================================================================================================ end module prep_atm_mod - diff --git a/src/drivers/mct/main/prep_glc_mod.F90 b/src/drivers/mct/main/prep_glc_mod.F90 index e14f78a24a0..bb020f68ee9 100644 --- a/src/drivers/mct/main/prep_glc_mod.F90 +++ b/src/drivers/mct/main/prep_glc_mod.F90 @@ -89,7 +89,7 @@ module prep_glc_mod ! Fields needed in the g2x_lx attribute vector used as part of mapping qice from lnd to glc character(len=:), allocatable :: g2x_lx_fields - + !================================================================================================ @@ -662,9 +662,9 @@ subroutine prep_glc_map_qice_conservative_lnd2glc(egi, eli, fractions_lx, & ! (For CISM with a polar stereographic projection, area_g can differ from aream_g ! by up to ~10%.) ! If so, then the calls to subroutine mct_avect_vecmult in component_mod.F90 - ! (just before and after the call to comp_run) should adjust the SMB fluxes - ! such that in each grid cell, the native value of area*flux is equal to the - ! coupler value of aream*flux. This assumes that the SMB field is contained in + ! (just before and after the call to comp_run) should adjust the SMB fluxes + ! such that in each grid cell, the native value of area*flux is equal to the + ! coupler value of aream*flux. This assumes that the SMB field is contained in ! seq_fields l2x_fluxes and seq_fields_x2g_fluxes. real(r8), dimension(:), allocatable :: aream_g ! cell areas on glc grid, for mapping @@ -719,10 +719,10 @@ subroutine prep_glc_map_qice_conservative_lnd2glc(egi, eli, fractions_lx, & ! Export the remapped SMB to a local array allocate(qice_g(lsize_g)) call mct_aVect_exportRattr(l2x_gx(eli), trim(qice_fieldname), qice_g) - + ! Make a preemptive adjustment to qice_g to account for area differences between CISM and the coupler. ! In component_mod.F90, there is a call to mct_avect_vecmult, which multiplies the fluxes - ! by aream_g/area_g for conservation purposes. Where CISM areas are larger (area_g > aream_g), + ! by aream_g/area_g for conservation purposes. Where CISM areas are larger (area_g > aream_g), ! the fluxes are reduced, and where CISM areas are smaller, the fluxes are increased. ! As a result, an SMB of 1 m/yr in CLM would be converted to an SMB ranging from ! ~0.9 to 1.05 m/yr in CISM (with smaller values where CISM areas are larger, and larger @@ -830,7 +830,7 @@ subroutine prep_glc_renormalize_smb(eli, fractions_lx, g2x_gx, mapper_Fg2l, area character(len=:), allocatable :: qice_field character(len=:), allocatable :: frac_field - ! local and global sums of accumulation and ablation; used to compute renormalization factors + ! local and global sums of accumulation and ablation; used to compute renormalization factors real(r8) :: local_accum_on_land_grid real(r8) :: global_accum_on_land_grid diff --git a/src/drivers/mct/main/prep_ice_mod.F90 b/src/drivers/mct/main/prep_ice_mod.F90 index ea93e0136d6..4b44e698f8b 100644 --- a/src/drivers/mct/main/prep_ice_mod.F90 +++ b/src/drivers/mct/main/prep_ice_mod.F90 @@ -256,7 +256,7 @@ subroutine prep_ice_merge(flux_epbalfact, a2x_i, o2x_i, r2x_i, g2x_i, x2i_i ) integer, save :: index_a2x_Faxa_rainl_18O integer, save :: index_a2x_Faxa_snowc_18O integer, save :: index_a2x_Faxa_snowl_18O - integer, save :: index_x2i_Faxa_rain_18O + integer, save :: index_x2i_Faxa_rain_18O integer, save :: index_x2i_Faxa_snow_18O integer, save :: index_a2x_Faxa_rainc_HDO integer, save :: index_a2x_Faxa_rainl_HDO @@ -399,8 +399,8 @@ subroutine prep_ice_merge(flux_epbalfact, a2x_i, o2x_i, r2x_i, g2x_i, x2i_i ) x2i_i%rAttr(index_x2i_Faxa_rain_16O,i) = a2x_i%rAttr(index_a2x_Faxa_rainc_16O,i) + & a2x_i%rAttr(index_a2x_Faxa_rainl_16O,i) x2i_i%rAttr(index_x2i_Faxa_snow_16O,i) = a2x_i%rAttr(index_a2x_Faxa_snowc_16O,i) + & - a2x_i%rAttr(index_a2x_Faxa_snowl_16O,i) - + a2x_i%rAttr(index_a2x_Faxa_snowl_16O,i) + x2i_i%rAttr(index_x2i_Faxa_rain_16O,i) = x2i_i%rAttr(index_x2i_Faxa_rain_16O,i) * flux_epbalfact x2i_i%rAttr(index_x2i_Faxa_snow_16O,i) = x2i_i%rAttr(index_x2i_Faxa_snow_16O,i) * flux_epbalfact end if @@ -408,8 +408,8 @@ subroutine prep_ice_merge(flux_epbalfact, a2x_i, o2x_i, r2x_i, g2x_i, x2i_i ) x2i_i%rAttr(index_x2i_Faxa_rain_18O,i) = a2x_i%rAttr(index_a2x_Faxa_rainc_18O,i) + & a2x_i%rAttr(index_a2x_Faxa_rainl_18O,i) x2i_i%rAttr(index_x2i_Faxa_snow_18O,i) = a2x_i%rAttr(index_a2x_Faxa_snowc_18O,i) + & - a2x_i%rAttr(index_a2x_Faxa_snowl_18O,i) - + a2x_i%rAttr(index_a2x_Faxa_snowl_18O,i) + x2i_i%rAttr(index_x2i_Faxa_rain_18O,i) = x2i_i%rAttr(index_x2i_Faxa_rain_18O,i) * flux_epbalfact x2i_i%rAttr(index_x2i_Faxa_snow_18O,i) = x2i_i%rAttr(index_x2i_Faxa_snow_18O,i) * flux_epbalfact end if @@ -417,8 +417,8 @@ subroutine prep_ice_merge(flux_epbalfact, a2x_i, o2x_i, r2x_i, g2x_i, x2i_i ) x2i_i%rAttr(index_x2i_Faxa_rain_HDO,i) = a2x_i%rAttr(index_a2x_Faxa_rainc_HDO,i) + & a2x_i%rAttr(index_a2x_Faxa_rainl_HDO,i) x2i_i%rAttr(index_x2i_Faxa_snow_HDO,i) = a2x_i%rAttr(index_a2x_Faxa_snowc_HDO,i) + & - a2x_i%rAttr(index_a2x_Faxa_snowl_HDO,i) - + a2x_i%rAttr(index_a2x_Faxa_snowl_HDO,i) + x2i_i%rAttr(index_x2i_Faxa_rain_HDO,i) = x2i_i%rAttr(index_x2i_Faxa_rain_HDO,i) * flux_epbalfact x2i_i%rAttr(index_x2i_Faxa_snow_HDO,i) = x2i_i%rAttr(index_x2i_Faxa_snow_HDO,i) * flux_epbalfact end if diff --git a/src/drivers/mct/main/prep_ocn_mod.F90 b/src/drivers/mct/main/prep_ocn_mod.F90 index f27222cc5b5..6f14a5aca9f 100644 --- a/src/drivers/mct/main/prep_ocn_mod.F90 +++ b/src/drivers/mct/main/prep_ocn_mod.F90 @@ -1345,4 +1345,3 @@ function prep_ocn_get_mapper_Sw2o() end function prep_ocn_get_mapper_Sw2o end module prep_ocn_mod - diff --git a/src/drivers/mct/main/seq_diag_mct.F90 b/src/drivers/mct/main/seq_diag_mct.F90 index 4628e6557d8..c08e12f9035 100644 --- a/src/drivers/mct/main/seq_diag_mct.F90 +++ b/src/drivers/mct/main/seq_diag_mct.F90 @@ -79,7 +79,7 @@ module seq_diag_mct & (shr_const_ocn_ref_sal*shr_const_latice) real(r8),parameter :: SFLXtoWFLX = & ! water flux implied by salt flux - ! WFLX (kg/m^2s) = -SFLX (kg/m^2s) + ! WFLX (kg/m^2s) = -SFLX (kg/m^2s) ! / ocn_ref_sal (psu) (34.7g/kg) ! / 1.e-3 kg/g -1._r8/(shr_const_ocn_ref_sal*1.e-3_r8) @@ -130,7 +130,7 @@ module seq_diag_mct integer(in),parameter :: f_hlwdn = 5 ! heat : longwave down integer(in),parameter :: f_hlwup = 6 ! heat : longwave up integer(in),parameter :: f_hlatv = 7 ! heat : latent, vaporization - integer(in),parameter :: f_hlatf = 8 ! heat : latent, fusion, snow + integer(in),parameter :: f_hlatf = 8 ! heat : latent, fusion, snow integer(in),parameter :: f_hioff = 9 ! heat : latent, fusion, frozen runoff integer(in),parameter :: f_hsen =10 ! heat : sensible integer(in),parameter :: f_wfrz =11 ! water: freezing @@ -1113,7 +1113,7 @@ subroutine seq_diag_rof_mct( rof, frac_r, infodata) if = f_wroff_HDO; budg_dataL(if,ic,ip) = budg_dataL(if,ic,ip) + & dr*x2r_r%rAttr(index_x2r_Flrl_rofl_HDO,n) - + if = f_wioff_16O; budg_dataL(if,ic,ip) = budg_dataL(if,ic,ip) + & dr*x2r_r%rAttr(index_x2r_Flrl_rofi_16O,n) @@ -1335,9 +1335,9 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa if (present(do_o2x)) then if (first_time) then if (trim(cime_model) == 'acme') then - index_o2x_Fioo_frazil = mct_aVect_indexRA(o2x_o,'Fioo_frazil') + index_o2x_Fioo_frazil = mct_aVect_indexRA(o2x_o,'Fioo_frazil') else if (trim(cime_model) == 'cesm') then - index_o2x_Fioo_q = mct_aVect_indexRA(o2x_o,'Fioo_q') + index_o2x_Fioo_q = mct_aVect_indexRA(o2x_o,'Fioo_q') end if end if @@ -1362,10 +1362,10 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa if (present(do_xao)) then if (first_time) then - index_xao_Faox_lwup = mct_aVect_indexRA(xao_o,'Faox_lwup') - index_xao_Faox_lat = mct_aVect_indexRA(xao_o,'Faox_lat') - index_xao_Faox_sen = mct_aVect_indexRA(xao_o,'Faox_sen') - index_xao_Faox_evap = mct_aVect_indexRA(xao_o,'Faox_evap') + index_xao_Faox_lwup = mct_aVect_indexRA(xao_o,'Faox_lwup') + index_xao_Faox_lat = mct_aVect_indexRA(xao_o,'Faox_lat') + index_xao_Faox_sen = mct_aVect_indexRA(xao_o,'Faox_sen') + index_xao_Faox_evap = mct_aVect_indexRA(xao_o,'Faox_evap') index_xao_Faox_evap_16O = mct_aVect_indexRA(xao_o,'Faox_evap_16O',perrWith='quiet') if ( index_xao_Faox_evap_16O /= 0 ) flds_wiso_ocn = .true. @@ -1497,17 +1497,17 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa if = f_wsnow_HDO; budg_dataL(if,ic,ip) = budg_dataL(if,ic,ip) + & (do+di)*x2o_o%rAttr(index_x2o_Faxa_snow_HDO,n) - if = f_wroff_16O ; + if = f_wroff_16O ; budg_dataL(if,ic,ip) = budg_dataL(if,ic,ip) + (do+di)*x2o_o%rAttr(index_x2o_Foxx_rofl_16O,n) - if = f_wioff_16O ; + if = f_wioff_16O ; budg_dataL(if,ic,ip) = budg_dataL(if,ic,ip) + (do+di)*x2o_o%rAttr(index_x2o_Foxx_rofi_16O,n) - if = f_wroff_18O ; + if = f_wroff_18O ; budg_dataL(if,ic,ip) = budg_dataL(if,ic,ip) + (do+di)*x2o_o%rAttr(index_x2o_Foxx_rofl_18O,n) - if = f_wioff_18O ; + if = f_wioff_18O ; budg_dataL(if,ic,ip) = budg_dataL(if,ic,ip) + (do+di)*x2o_o%rAttr(index_x2o_Foxx_rofi_18O,n) - if = f_wroff_HDO ; + if = f_wroff_HDO ; budg_dataL(if,ic,ip) = budg_dataL(if,ic,ip) + (do+di)*x2o_o%rAttr(index_x2o_Foxx_rofl_HDO,n) - if = f_wioff_HDO ; + if = f_wioff_HDO ; budg_dataL(if,ic,ip) = budg_dataL(if,ic,ip) + (do+di)*x2o_o%rAttr(index_x2o_Foxx_rofi_HDO,n) end if end do @@ -1655,9 +1655,9 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) index_x2i_Faxa_rain = mct_aVect_indexRA(x2i_i,'Faxa_rain') index_x2i_Faxa_snow = mct_aVect_indexRA(x2i_i,'Faxa_snow') if (trim(cime_model) == 'acme') then - index_x2i_Fioo_frazil = mct_aVect_indexRA(x2i_i,'Fioo_frazil') + index_x2i_Fioo_frazil = mct_aVect_indexRA(x2i_i,'Fioo_frazil') else if (trim(cime_model) == 'cesm') then - index_x2i_Fioo_q = mct_aVect_indexRA(x2i_i,'Fioo_q') + index_x2i_Fioo_q = mct_aVect_indexRA(x2i_i,'Fioo_q') end if index_x2i_Fixx_rofi = mct_aVect_indexRA(x2i_i,'Fixx_rofi') @@ -1889,12 +1889,12 @@ SUBROUTINE seq_diag_print_mct(EClock, stop_alarm, & write(logunit,FA1) fname(if),dataGpr(if,ica,ip),dataGpr(if,icl,ip), & dataGpr(if,icn,ip),dataGpr(if,ics,ip),dataGpr(if,ico,ip), & dataGpr(if,ica,ip)+dataGpr(if,icl,ip)+ & - dataGpr(if,icn,ip)+dataGpr(if,ics,ip)+dataGpr(if,ico,ip) + dataGpr(if,icn,ip)+dataGpr(if,ics,ip)+dataGpr(if,ico,ip) enddo write(logunit,FA1) ' *SUM*' ,sum(dataGpr(f_h:f_h_end,ica,ip)),sum(dataGpr(f_h:f_h_end,icl,ip)), & sum(dataGpr(f_h:f_h_end,icn,ip)),sum(dataGpr(f_h:f_h_end,ics,ip)),sum(dataGpr(f_h:f_h_end,ico,ip)), & sum(dataGpr(f_h:f_h_end,ica,ip))+sum(dataGpr(f_h:f_h_end,icl,ip))+ & - sum(dataGpr(f_h:f_h_end,icn,ip))+sum(dataGpr(f_h:f_h_end,ics,ip))+sum(dataGpr(f_h:f_h_end,ico,ip)) + sum(dataGpr(f_h:f_h_end,icn,ip))+sum(dataGpr(f_h:f_h_end,ics,ip))+sum(dataGpr(f_h:f_h_end,ico,ip)) write(logunit,*) ' ' write(logunit,FAH) subname,trim(str)//' WATER BUDGET (kg/m2s*1e6): period = ',trim(pname(ip)),': date = ',cdate,sec @@ -1908,7 +1908,7 @@ SUBROUTINE seq_diag_print_mct(EClock, stop_alarm, & write(logunit,FA1) ' *SUM*' ,sum(dataGpr(f_w:f_w_end,ica,ip)),sum(dataGpr(f_w:f_w_end,icl,ip)), & sum(dataGpr(f_w:f_w_end,icn,ip)),sum(dataGpr(f_w:f_w_end,ics,ip)),sum(dataGpr(f_w:f_w_end,ico,ip)), & sum(dataGpr(f_w:f_w_end,ica,ip))+sum(dataGpr(f_w:f_w_end,icl,ip))+ & - sum(dataGpr(f_w:f_w_end,icn,ip))+sum(dataGpr(f_w:f_w_end,ics,ip))+sum(dataGpr(f_w:f_w_end,ico,ip)) + sum(dataGpr(f_w:f_w_end,icn,ip))+sum(dataGpr(f_w:f_w_end,ics,ip))+sum(dataGpr(f_w:f_w_end,ico,ip)) if ( flds_wiso )then do is = 1, nisotopes @@ -2120,7 +2120,7 @@ SUBROUTINE seq_diag_print_mct(EClock, stop_alarm, & sum(dataGpr(f_w:f_w_end,c_inh_ir,ip))+sum(dataGpr(f_w:f_w_end,c_inh_is,ip))+ & sum(dataGpr(f_w:f_w_end,c_ish_ir,ip))+sum(dataGpr(f_w:f_w_end,c_ish_is,ip))+ & sum(dataGpr(f_w:f_w_end,c_glc_gr,ip))+sum(dataGpr(f_w:f_w_end,c_glc_gs,ip)) - + if ( flds_wiso ) then do is = 1, nisotopes diff --git a/src/drivers/mct/main/seq_domain_mct.F90 b/src/drivers/mct/main/seq_domain_mct.F90 index 3155974cbca..bc85b754ccb 100644 --- a/src/drivers/mct/main/seq_domain_mct.F90 +++ b/src/drivers/mct/main/seq_domain_mct.F90 @@ -791,6 +791,3 @@ end subroutine seq_domain_areafactinit !=============================================================================== end module seq_domain_mct - - - diff --git a/src/drivers/mct/main/seq_flux_mct.F90 b/src/drivers/mct/main/seq_flux_mct.F90 index ef0ca05e142..1b26aa2442c 100644 --- a/src/drivers/mct/main/seq_flux_mct.F90 +++ b/src/drivers/mct/main/seq_flux_mct.F90 @@ -1,5 +1,5 @@ module seq_flux_mct - + use shr_kind_mod, only: r8 => shr_kind_r8, in=>shr_kind_in use shr_sys_mod, only: shr_sys_abort use shr_flux_mod, only: shr_flux_atmocn, shr_flux_atmocn_diurnal @@ -14,7 +14,7 @@ module seq_flux_mct use component_type_mod implicit none - private + private save !-------------------------------------------------------------------------- @@ -42,20 +42,20 @@ module seq_flux_mct real(r8), allocatable :: vocn (:) ! ocn velocity, meridional real(r8), allocatable :: tocn (:) ! ocean temperature real(r8), allocatable :: zbot (:) ! atm level height - real(r8), allocatable :: ubot (:) ! atm velocity, zonal + real(r8), allocatable :: ubot (:) ! atm velocity, zonal real(r8), allocatable :: vbot (:) ! atm velocity, meridional real(r8), allocatable :: thbot(:) ! atm potential T real(r8), allocatable :: shum (:) ! atm specific humidity real(r8), allocatable :: shum_16O (:) ! atm H2O tracer real(r8), allocatable :: shum_HDO (:) ! atm HDO tracer real(r8), allocatable :: shum_18O (:) ! atm H218O tracer - real(r8), allocatable :: roce_16O (:) ! ocn H2O ratio - real(r8), allocatable :: roce_HDO (:) ! ocn HDO ratio - real(r8), allocatable :: roce_18O (:) ! ocn H218O ratio + real(r8), allocatable :: roce_16O (:) ! ocn H2O ratio + real(r8), allocatable :: roce_HDO (:) ! ocn HDO ratio + real(r8), allocatable :: roce_18O (:) ! ocn H218O ratio real(r8), allocatable :: dens (:) ! atm density real(r8), allocatable :: tbot (:) ! atm bottom surface T - real(r8), allocatable :: sen (:) ! heat flux: sensible - real(r8), allocatable :: lat (:) ! heat flux: latent + real(r8), allocatable :: sen (:) ! heat flux: sensible + real(r8), allocatable :: lat (:) ! heat flux: latent real(r8), allocatable :: lwup (:) ! lwup over ocean real(r8), allocatable :: evap (:) ! water flux: evaporation real(r8), allocatable :: evap_16O (:) !H2O flux: evaporation @@ -77,17 +77,17 @@ module seq_flux_mct real(r8), allocatable :: prec_gust (:) ! atm precip for convective gustiness (kg/m^3) ! Diurnal cycle variables wrt flux - - real(r8), allocatable :: tbulk (:) ! diagnostic: ocn bulk T - real(r8), allocatable :: tskin (:) ! diagnostic: ocn skin T - real(r8), allocatable :: tskin_night(:) ! diagnostic: ocn skin T - real(r8), allocatable :: tskin_day (:) ! diagnostic: ocn skin T - real(r8), allocatable :: cSkin (:) ! diagnostic: ocn cool skin - real(r8), allocatable :: cSkin_night(:) ! diagnostic: ocn cool skin - real(r8), allocatable :: warm (:) ! diagnostic: ocn warming - real(r8), allocatable :: salt (:) ! diagnostic: ocn salting - real(r8), allocatable :: speed (:) ! diagnostic: ocn speed - real(r8), allocatable :: regime (:) ! diagnostic: ocn regime + + real(r8), allocatable :: tbulk (:) ! diagnostic: ocn bulk T + real(r8), allocatable :: tskin (:) ! diagnostic: ocn skin T + real(r8), allocatable :: tskin_night(:) ! diagnostic: ocn skin T + real(r8), allocatable :: tskin_day (:) ! diagnostic: ocn skin T + real(r8), allocatable :: cSkin (:) ! diagnostic: ocn cool skin + real(r8), allocatable :: cSkin_night(:) ! diagnostic: ocn cool skin + real(r8), allocatable :: warm (:) ! diagnostic: ocn warming + real(r8), allocatable :: salt (:) ! diagnostic: ocn salting + real(r8), allocatable :: speed (:) ! diagnostic: ocn speed + real(r8), allocatable :: regime (:) ! diagnostic: ocn regime real(r8), allocatable :: warmMax (:) ! diagnostic: ocn warming, max daily value real(r8), allocatable :: windMax (:) ! diagnostic: ocn wind , max daily value real(r8), allocatable :: QsolAvg (:) ! diagnostic: ocn Qsol , daily avg @@ -109,16 +109,16 @@ module seq_flux_mct ! Coupler field indices - integer :: index_a2x_Sa_z - integer :: index_a2x_Sa_u - integer :: index_a2x_Sa_v - integer :: index_a2x_Sa_tbot - integer :: index_a2x_Sa_ptem - integer :: index_a2x_Sa_shum + integer :: index_a2x_Sa_z + integer :: index_a2x_Sa_u + integer :: index_a2x_Sa_v + integer :: index_a2x_Sa_tbot + integer :: index_a2x_Sa_ptem + integer :: index_a2x_Sa_shum integer :: index_a2x_Sa_shum_16O integer :: index_a2x_Sa_shum_HDO integer :: index_a2x_Sa_shum_18O - integer :: index_a2x_Sa_dens + integer :: index_a2x_Sa_dens integer :: index_a2x_Faxa_swndr integer :: index_a2x_Faxa_swndf integer :: index_a2x_Faxa_swvdr @@ -128,7 +128,7 @@ module seq_flux_mct integer :: index_a2x_Faxa_rainl integer :: index_a2x_Faxa_snowc integer :: index_a2x_Faxa_snowl - integer :: index_o2x_So_t + integer :: index_o2x_So_t integer :: index_o2x_So_u integer :: index_o2x_So_v integer :: index_o2x_So_fswpen @@ -136,17 +136,17 @@ module seq_flux_mct integer :: index_o2x_So_roce_16O integer :: index_o2x_So_roce_HDO integer :: index_o2x_So_roce_18O - integer :: index_xao_So_tref - integer :: index_xao_So_qref - integer :: index_xao_So_avsdr - integer :: index_xao_So_avsdf - integer :: index_xao_So_anidr - integer :: index_xao_So_anidf - integer :: index_xao_Faox_taux - integer :: index_xao_Faox_tauy - integer :: index_xao_Faox_lat - integer :: index_xao_Faox_sen - integer :: index_xao_Faox_evap + integer :: index_xao_So_tref + integer :: index_xao_So_qref + integer :: index_xao_So_avsdr + integer :: index_xao_So_avsdf + integer :: index_xao_So_anidr + integer :: index_xao_So_anidf + integer :: index_xao_Faox_taux + integer :: index_xao_Faox_tauy + integer :: index_xao_Faox_lat + integer :: index_xao_Faox_sen + integer :: index_xao_Faox_evap integer :: index_xao_Faox_evap_16O integer :: index_xao_Faox_evap_HDO integer :: index_xao_Faox_evap_18O @@ -154,9 +154,9 @@ module seq_flux_mct integer :: index_xao_Faox_swdn integer :: index_xao_Faox_swup integer :: index_xao_So_ustar - integer :: index_xao_So_re - integer :: index_xao_So_ssq - integer :: index_xao_So_duu10n + integer :: index_xao_So_re + integer :: index_xao_So_ssq + integer :: index_xao_So_duu10n integer :: index_xao_So_u10 integer :: index_xao_So_fswpen integer :: index_xao_So_warm_diurn @@ -185,9 +185,9 @@ module seq_flux_mct !--- for exchange grid --- type(mct_rearr) :: Re_a2e, Re_e2a, Re_o2e, Re_e2o ! atm/ocn/exch rearrangers - type(mct_sMat ) :: sMata2o, sMato2a ! decomp sMat + type(mct_sMat ) :: sMata2o, sMato2a ! decomp sMat type(mct_gsMap) :: gsmap_ae, gsmap_oe ! gsmaps for atm/ocn on exch grid - integer(in) :: nloc_a2o,nloc_o2a,nloc_o,nloc_a,nloc_ae,nloc_oe + integer(in) :: nloc_a2o,nloc_o2a,nloc_o,nloc_a,nloc_ae,nloc_oe !=============================================================================== contains @@ -213,8 +213,8 @@ subroutine seq_flux_init_mct(comp, fractions) character(*),parameter :: subName = '(seq_flux_init_mct) ' !----------------------------------------------------------------------- - gsmap => component_get_gsmap_cx(comp) - dom => component_get_dom_cx(comp) + gsmap => component_get_gsmap_cx(comp) + dom => component_get_dom_cx(comp) nloc = mct_avect_lsize(dom%data) @@ -277,7 +277,7 @@ subroutine seq_flux_init_mct(comp, fractions) if(ier/=0) call mct_die(subName,'allocate roce_18O',ier) roce_18O = 0.0_r8 - ! Output fields + ! Output fields allocate(sen (nloc),stat=ier) if(ier/=0) call mct_die(subName,'allocate sen',ier) sen = 0.0_r8 @@ -414,12 +414,12 @@ subroutine seq_flux_init_mct(comp, fractions) allocate(mask(nloc),stat=ier) if(ier/=0) call mct_die(subName,'allocate mask',ier) mask = 0.0_r8 - + ! Get lat, lon, mask, which is time-invariant allocate(rmask(nloc),stat=ier) if(ier/=0) call mct_die(subName,'allocate rmask',ier) - call mct_gGrid_exportRAttr(dom, 'lat' , lats , nloc) - call mct_gGrid_exportRAttr(dom, 'lon' , lons , nloc) + call mct_gGrid_exportRAttr(dom, 'lat' , lats , nloc) + call mct_gGrid_exportRAttr(dom, 'lon' , lons , nloc) ! setup the compute mask. ! prefer to compute just where ocean exists, so setup a mask here. @@ -434,7 +434,7 @@ subroutine seq_flux_init_mct(comp, fractions) ! default compute everywhere, then "turn off" gridcells mask = 1 - + ! use domain mask first call mct_gGrid_exportRAttr(dom, 'mask', rmask, nloc) where (rmask < 0.5_r8) mask = 0 ! like nint @@ -459,7 +459,7 @@ subroutine seq_flux_initexch_mct(atm, ocn, mpicom_cplid, cplid) ! ! Arguments ! - type(component_type), intent(in) :: atm + type(component_type), intent(in) :: atm type(component_type), intent(in) :: ocn integer(in) , intent(in) :: mpicom_cplid integer(in) , intent(in) :: cplid @@ -623,7 +623,7 @@ subroutine seq_flux_initexch_mct(atm, ocn, mpicom_cplid, cplid) allocate( tocn(nloc_a2o),stat=ier) if(ier/=0) call mct_die(subName,'allocate tocn',ier) - ! Output fields + ! Output fields allocate(sen (nloc_a2o),stat=ier) if(ier/=0) call mct_die(subName,'allocate sen',ier) allocate(lat (nloc_a2o),stat=ier) @@ -711,10 +711,10 @@ subroutine seq_flux_ocnalb_mct( infodata, ocn, a2x_o, fractions_o, xao_o ) integer(in) :: kx,kr ! fractions indices integer(in) :: klat,klon,kmsk ! field indices logical :: update_alb ! was albedo updated - logical,save :: first_call = .true. + logical,save :: first_call = .true. ! real(r8),parameter :: albdif = 0.06_r8 ! 60 deg reference albedo, diffuse - real(r8),parameter :: albdir = 0.07_r8 ! 60 deg reference albedo, direct + real(r8),parameter :: albdir = 0.07_r8 ! 60 deg reference albedo, direct character(*),parameter :: subName = '(seq_flux_ocnalb_mct) ' ! !----------------------------------------------------------------------- @@ -757,7 +757,7 @@ subroutine seq_flux_ocnalb_mct( infodata, ocn, a2x_o, fractions_o, xao_o ) if (flux_albav) then - do n=1,nloc_o + do n=1,nloc_o anidr = albdir avsdr = albdir anidf = albdif @@ -802,15 +802,15 @@ subroutine seq_flux_ocnalb_mct( infodata, ocn, a2x_o, fractions_o, xao_o ) xao_o%rAttr(index_xao_Faox_swup,n) = swupc end do - ! Solar declination + ! Solar declination ! Will only do albedo calculation if nextsw_cday is not -1. - + call seq_infodata_GetData(infodata,nextsw_cday=nextsw_cday,orb_eccen=eccen, & orb_mvelpp=mvelpp, orb_lambm0=lambm0, orb_obliqr=obliqr) if (nextsw_cday >= -0.5_r8) then calday = nextsw_cday call shr_orb_decl(calday, eccen, mvelpp,lambm0, obliqr, delta, eccf) - ! Compute albedos + ! Compute albedos do n=1,nloc_o rlat = const_deg2rad * lats(n) rlon = const_deg2rad * lons(n) @@ -850,7 +850,7 @@ subroutine seq_flux_ocnalb_mct( infodata, ocn, a2x_o, fractions_o, xao_o ) kr = mct_aVect_indexRA(fractions_o,"ofrad") fractions_o%rAttr(kr,:) = fractions_o%rAttr(kx,:) endif - + end subroutine seq_flux_ocnalb_mct !=============================================================================== @@ -888,30 +888,30 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o integer(in) :: kw,ka,ko,iw,ia,io,kf integer(in) :: n,i ! indices logical :: dead_comps ! .true. => dead components are used - integer(in) :: index_tref - integer(in) :: index_qref + integer(in) :: index_tref + integer(in) :: index_qref integer(in) :: index_duu10n - integer(in) :: index_ustar - integer(in) :: index_ssq - integer(in) :: index_re - integer(in) :: index_u10 - integer(in) :: index_taux - integer(in) :: index_tauy - integer(in) :: index_lat - integer(in) :: index_sen - integer(in) :: index_evap + integer(in) :: index_ustar + integer(in) :: index_ssq + integer(in) :: index_re + integer(in) :: index_u10 + integer(in) :: index_taux + integer(in) :: index_tauy + integer(in) :: index_lat + integer(in) :: index_sen + integer(in) :: index_evap integer(in) :: index_evap_16O integer(in) :: index_evap_HDO integer(in) :: index_evap_18O - integer(in) :: index_lwup + integer(in) :: index_lwup integer(in) :: index_sumwt integer(in) :: atm_nx,atm_ny,ocn_nx,ocn_ny real(r8) :: wt real(r8) :: gust_fac = huge(1.0_r8) !wind gust factor integer(in) :: tod, dt - logical,save:: first_call = .true. + logical,save:: first_call = .true. logical :: read_restart ! .true. => model starting from restart - logical :: ocn_prognostic ! .true. => ocn is prognostic + logical :: ocn_prognostic ! .true. => ocn is prognostic logical :: flux_diurnal ! .true. => turn on diurnal cycle in atm/ocn fluxes logical :: cold_start ! .true. to initialize internal fields in shr_flux diurnal character(len=256) :: fldlist ! subset of xao fields @@ -920,16 +920,16 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o ! !----------------------------------------------------------------------- - gsmap_a => component_get_gsmap_cx(atm) - gsmap_o => component_get_gsmap_cx(ocn) + gsmap_a => component_get_gsmap_cx(atm) + gsmap_o => component_get_gsmap_cx(ocn) a2x => component_get_c2x_cx(atm) ! a2x_ax - o2x => component_get_c2x_cx(ocn) ! o2x_ox + o2x => component_get_c2x_cx(ocn) ! o2x_ox if (trim(fluxsetting) /= trim(fluxsetting_exchange)) then call shr_sys_abort(trim(subname)//' ERROR wrong fluxsetting') endif - ! Update ocean surface fluxes + ! Update ocean surface fluxes ! Must fabricate "reasonable" data (using dead components) call seq_infodata_GetData(infodata, & @@ -945,7 +945,7 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o if (first_call) then if (.not.read_restart) cold_start = .true. - first_call = .false. + first_call = .false. endif if (dead_comps) then @@ -959,15 +959,15 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o thbot(n)= 301.0_r8 ! atm potential temperature ~ Kelvin shum(n) = 1.e-2_r8 ! atm specific humidity ~ kg/kg shum_16O(n) = 1.e-2_r8 ! H216O specific humidity ~ kg/kg - shum_HDO(n) = 1.e-2_r8 ! HD16O specificy humidity ~ kg/kg + shum_HDO(n) = 1.e-2_r8 ! HD16O specificy humidity ~ kg/kg shum_18O(n) = 1.e-2_r8 ! H218O specific humidity ~ kg/kg roce_16O(n) = 1.0_r8 ! H216O ratio ~ mol/mol - roce_HDO(n) = 1.0_r8 ! HD16O ratio ~ mol/mol + roce_HDO(n) = 1.0_r8 ! HD16O ratio ~ mol/mol roce_18O(n) = 1.0_r8 ! H218O ratio ~ mol/mol dens(n) = 1.0_r8 ! atm density ~ kg/m^3 tbot(n) = 300.0_r8 ! atm temperature ~ Kelvin enddo - else + else !--- instantiate exchange grid aVects call mct_AVect_init(a2x_e, a2x, nloc_ae) @@ -998,7 +998,7 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o shum_18O(n) = a2x_e%rAttr(index_a2x_Sa_shum_18O,ia) dens(n) = a2x_e%rAttr(index_a2x_Sa_dens,ia) tbot(n) = a2x_e%rAttr(index_a2x_Sa_tbot,ia) - tocn(n) = o2x_e%rAttr(index_o2x_So_t ,io) + tocn(n) = o2x_e%rAttr(index_o2x_So_t ,io) uocn(n) = o2x_e%rAttr(index_o2x_So_u ,io) vocn(n) = o2x_e%rAttr(index_o2x_So_v ,io) roce_16O(n) = o2x_e%rAttr(index_o2x_So_roce_16O, io) @@ -1028,7 +1028,7 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o call shr_flux_atmocn (nloc_a2o , zbot , ubot, vbot, thbot, prec_gust, gust_fac, & shum , shum_16O , shum_HDO, shum_18O, dens , tbot, uocn, vocn , & tocn , emask, sen , lat , lwup , & - roce_16O, roce_HDO, roce_18O, & + roce_16O, roce_HDO, roce_18O, & evap , evap_16O, evap_HDO, evap_18O, taux, tauy, tref, qref , & duu10n,ustar, re , ssq , missval = 0.0_r8 ) endif @@ -1086,8 +1086,8 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o xaop_oe%rAttr(index_ustar ,io) = xaop_oe%rAttr(index_ustar ,io) + ustar(n)*wt ! friction velocity xaop_oe%rAttr(index_re ,io) = xaop_oe%rAttr(index_re ,io) + re(n) * wt ! reynolds number xaop_oe%rAttr(index_ssq ,io) = xaop_oe%rAttr(index_ssq ,io) + ssq(n) * wt ! s.hum. saturation at Ts - xaop_oe%rAttr(index_lwup ,io) = xaop_oe%rAttr(index_lwup ,io) + lwup(n)* wt - xaop_oe%rAttr(index_duu10n,io) = xaop_oe%rAttr(index_duu10n,io) + duu10n(n)*wt + xaop_oe%rAttr(index_lwup ,io) = xaop_oe%rAttr(index_lwup ,io) + lwup(n)* wt + xaop_oe%rAttr(index_duu10n,io) = xaop_oe%rAttr(index_duu10n,io) + duu10n(n)*wt xaop_oe%rAttr(index_u10 ,io) = xaop_oe%rAttr(index_u10 ,io) + sqrt(duu10n(n))*wt xaop_oe%rAttr(index_sumwt ,io) = xaop_oe%rAttr(index_sumwt ,io) + wt enddo @@ -1120,8 +1120,8 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o xaop_ae%rAttr(index_ustar ,ia) = xaop_ae%rAttr(index_ustar ,ia) + ustar(n)*wt ! friction velocity xaop_ae%rAttr(index_re ,ia) = xaop_ae%rAttr(index_re ,ia) + re(n) * wt ! reynolds number xaop_ae%rAttr(index_ssq ,ia) = xaop_ae%rAttr(index_ssq ,ia) + ssq(n) * wt ! s.hum. saturation at Ts - xaop_ae%rAttr(index_lwup ,ia) = xaop_ae%rAttr(index_lwup ,ia) + lwup(n)* wt - xaop_ae%rAttr(index_duu10n,ia) = xaop_ae%rAttr(index_duu10n,ia) + duu10n(n)*wt + xaop_ae%rAttr(index_lwup ,ia) = xaop_ae%rAttr(index_lwup ,ia) + lwup(n)* wt + xaop_ae%rAttr(index_duu10n,ia) = xaop_ae%rAttr(index_duu10n,ia) + duu10n(n)*wt xaop_ae%rAttr(index_u10 ,ia) = xaop_ae%rAttr(index_u10 ,ia) + sqrt(duu10n(n))*wt xaop_ae%rAttr(index_sumwt ,ia) = xaop_ae%rAttr(index_sumwt ,ia) + wt enddo @@ -1139,7 +1139,7 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o do n = 1,nloc_a wt = xaop_a%rAttr(index_sumwt,n) - if (wt /= 0.0_r8) then + if (wt /= 0.0_r8) then wt = 1.0_r8/wt else wt = 1.0_r8 @@ -1149,7 +1149,7 @@ subroutine seq_flux_atmocnexch_mct( infodata, atm, ocn, fractions_a, fractions_o do n = 1,nloc_o wt = xaop_o%rAttr(index_sumwt,n) - if (wt /= 0.0_r8) then + if (wt /= 0.0_r8) then wt = 1.0_r8/wt else wt = 1.0_r8 @@ -1210,11 +1210,11 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) logical,save:: first_call = .true. logical :: cold_start ! .true. to initialize internal fields in shr_flux diurnal logical :: read_restart ! .true. => continue run - logical :: ocn_prognostic ! .true. => ocn is prognostic + logical :: ocn_prognostic ! .true. => ocn is prognostic logical :: flux_diurnal ! .true. => turn on diurnal cycle in atm/ocn fluxes ! real(r8),parameter :: albdif = 0.06_r8 ! 60 deg reference albedo, diffuse - real(r8),parameter :: albdir = 0.07_r8 ! 60 deg reference albedo, direct + real(r8),parameter :: albdir = 0.07_r8 ! 60 deg reference albedo, direct character(*),parameter :: subName = '(seq_flux_atmocn_mct) ' ! !----------------------------------------------------------------------- @@ -1222,7 +1222,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) call seq_infodata_getData(infodata , & read_restart=read_restart, & flux_albav=flux_albav, & - dead_comps=dead_comps, & + dead_comps=dead_comps, & ocn_prognostic=ocn_prognostic, & flux_diurnal=flux_diurnal, & gust_fac = gust_fac ) @@ -1233,20 +1233,20 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) if (.not.read_restart) cold_start = .true. index_xao_So_tref = mct_aVect_indexRA(xao,'So_tref') index_xao_So_qref = mct_aVect_indexRA(xao,'So_qref') - index_xao_So_ustar = mct_aVect_indexRA(xao,'So_ustar') - index_xao_So_re = mct_aVect_indexRA(xao,'So_re') + index_xao_So_ustar = mct_aVect_indexRA(xao,'So_ustar') + index_xao_So_re = mct_aVect_indexRA(xao,'So_re') index_xao_So_ssq = mct_aVect_indexRA(xao,'So_ssq') index_xao_So_u10 = mct_aVect_indexRA(xao,'So_u10') index_xao_So_duu10n = mct_aVect_indexRA(xao,'So_duu10n') index_xao_Faox_taux = mct_aVect_indexRA(xao,'Faox_taux') - index_xao_Faox_tauy = mct_aVect_indexRA(xao,'Faox_tauy') - index_xao_Faox_lat = mct_aVect_indexRA(xao,'Faox_lat') - index_xao_Faox_sen = mct_aVect_indexRA(xao,'Faox_sen') - index_xao_Faox_evap = mct_aVect_indexRA(xao,'Faox_evap') + index_xao_Faox_tauy = mct_aVect_indexRA(xao,'Faox_tauy') + index_xao_Faox_lat = mct_aVect_indexRA(xao,'Faox_lat') + index_xao_Faox_sen = mct_aVect_indexRA(xao,'Faox_sen') + index_xao_Faox_evap = mct_aVect_indexRA(xao,'Faox_evap') index_xao_Faox_evap_16O = mct_aVect_indexRA(xao,'Faox_evap_16O', perrWith='quiet') index_xao_Faox_evap_HDO = mct_aVect_indexRA(xao,'Faox_evap_HDO', perrWith='quiet') index_xao_Faox_evap_18O = mct_aVect_indexRA(xao,'Faox_evap_18O', perrWith='quiet') - index_xao_Faox_lwup = mct_aVect_indexRA(xao,'Faox_lwup') + index_xao_Faox_lwup = mct_aVect_indexRA(xao,'Faox_lwup') index_xao_Faox_swdn = mct_aVect_indexRA(xao,'Faox_swdn') index_xao_Faox_swup = mct_aVect_indexRA(xao,'Faox_swup') index_xao_So_fswpen = mct_aVect_indexRA(xao,'So_fswpen') @@ -1269,7 +1269,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) index_xao_So_qsolinc_diurn = mct_aVect_indexRA(xao,'So_qsolinc_diurn') index_xao_So_windinc_diurn = mct_aVect_indexRA(xao,'So_windinc_diurn') index_xao_So_ninc_diurn = mct_aVect_indexRA(xao,'So_ninc_diurn') - + index_a2x_Sa_z = mct_aVect_indexRA(a2x,'Sa_z') index_a2x_Sa_u = mct_aVect_indexRA(a2x,'Sa_u') index_a2x_Sa_v = mct_aVect_indexRA(a2x,'Sa_v') @@ -1285,7 +1285,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) index_a2x_Faxa_rainl= mct_aVect_indexRA(a2x,'Faxa_rainl') index_a2x_Faxa_snowc= mct_aVect_indexRA(a2x,'Faxa_snowc') index_a2x_Faxa_snowl= mct_aVect_indexRA(a2x,'Faxa_snowl') - + index_o2x_So_t = mct_aVect_indexRA(o2x,'So_t') index_o2x_So_u = mct_aVect_indexRA(o2x,'So_u') index_o2x_So_v = mct_aVect_indexRA(o2x,'So_v') @@ -1296,7 +1296,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) index_o2x_So_roce_18O = mct_aVect_indexRA(o2x,'So_roce_18O', perrWith='quiet') first_call = .false. end if - + if (trim(fluxsetting) /= trim(fluxsetting_atmocn)) then call shr_sys_abort(trim(subname)//' ERROR wrong fluxsetting') endif @@ -1309,7 +1309,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) call shr_sys_abort(trim(subname)//' ERROR nloc sizes do not match') endif - ! Update ocean surface fluxes + ! Update ocean surface fluxes ! Must fabricate "reasonable" data (when using dead components) emask = mask @@ -1329,8 +1329,8 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) shum_HDO(n) = 1.e-2_r8 ! HD16O specific humidity ~ kg/kg shum_18O(n) = 1.e-2_r8 ! H218O specific humidity ~ kg/kg roce_16O(n) = 1.0_r8 ! H216O surface ratio ~ mol/mol - roce_HDO(n) = 1.0_r8 ! HDO surface ratio ~ mol/mol - roce_18O(n) = 1.0_r8 ! H218O surface ratio ~ mol/mol + roce_HDO(n) = 1.0_r8 ! HDO surface ratio ~ mol/mol + roce_18O(n) = 1.0_r8 ! H218O surface ratio ~ mol/mol dens(n) = 1.0_r8 ! atm density ~ kg/m^3 tbot(n) = 300.0_r8 ! atm temperature ~ Kelvin uGust(n)= 0.0_r8 @@ -1364,8 +1364,8 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) enddo else do n = 1,nloc - nInc(n) = 0._r8 ! needed for minval/maxval calculation - if (mask(n) /= 0) then + nInc(n) = 0._r8 ! needed for minval/maxval calculation + if (mask(n) /= 0) then zbot(n) = a2x%rAttr(index_a2x_Sa_z ,n) ubot(n) = a2x%rAttr(index_a2x_Sa_u ,n) vbot(n) = a2x%rAttr(index_a2x_Sa_v ,n) @@ -1376,7 +1376,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) if ( index_a2x_Sa_shum_18O /= 0 ) shum_18O(n) = a2x%rAttr(index_a2x_Sa_shum_18O,n) dens(n) = a2x%rAttr(index_a2x_Sa_dens,n) tbot(n) = a2x%rAttr(index_a2x_Sa_tbot,n) - tocn(n) = o2x%rAttr(index_o2x_So_t ,n) + tocn(n) = o2x%rAttr(index_o2x_So_t ,n) uocn(n) = o2x%rAttr(index_o2x_So_u ,n) vocn(n) = o2x%rAttr(index_o2x_So_v ,n) if ( index_o2x_So_roce_16O /= 0 ) roce_16O(n) = o2x%rAttr(index_o2x_So_roce_16O, n) @@ -1438,7 +1438,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) tbulk, tskin, tskin_day, tskin_night, & cskin, cskin_night, tod, dt, & duu10n,ustar, re , ssq, & - !missval should not be needed if flux calc + !missval should not be needed if flux calc !consistent with mrgx2a fraction !duu10n,ustar, re , ssq, missval = 0.0_r8 ) cold_start=cold_start) @@ -1449,13 +1449,13 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) roce_16O, roce_HDO, roce_18O, & evap , evap_16O, evap_HDO, evap_18O, taux , tauy, tref, qref , & duu10n,ustar, re , ssq) - !missval should not be needed if flux calc + !missval should not be needed if flux calc !consistent with mrgx2a fraction !duu10n,ustar, re , ssq, missval = 0.0_r8 ) endif do n = 1,nloc - if (mask(n) /= 0) then + if (mask(n) /= 0) then xao%rAttr(index_xao_Faox_sen ,n) = sen(n) xao%rAttr(index_xao_Faox_lat ,n) = lat(n) xao%rAttr(index_xao_Faox_taux,n) = taux(n) @@ -1469,9 +1469,9 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) xao%rAttr(index_xao_So_ustar ,n) = ustar(n) ! friction velocity xao%rAttr(index_xao_So_re ,n) = re(n) ! reynolds number xao%rAttr(index_xao_So_ssq ,n) = ssq(n) ! s.hum. saturation at Ts - xao%rAttr(index_xao_Faox_lwup,n) = lwup(n) - xao%rAttr(index_xao_So_duu10n,n) = duu10n(n) - xao%rAttr(index_xao_So_u10 ,n) = sqrt(duu10n(n)) + xao%rAttr(index_xao_Faox_lwup,n) = lwup(n) + xao%rAttr(index_xao_So_duu10n,n) = duu10n(n) + xao%rAttr(index_xao_So_u10 ,n) = sqrt(duu10n(n)) xao%rAttr(index_xao_So_warm_diurn ,n) = warm(n) xao%rAttr(index_xao_So_salt_diurn ,n) = salt(n) xao%rAttr(index_xao_So_speed_diurn ,n) = speed(n) diff --git a/src/drivers/mct/shr/CMakeLists.txt b/src/drivers/mct/shr/CMakeLists.txt index 03b69fd67c0..37bf92fb905 100644 --- a/src/drivers/mct/shr/CMakeLists.txt +++ b/src/drivers/mct/shr/CMakeLists.txt @@ -6,4 +6,4 @@ list(APPEND drv_sources seq_io_read_mod.F90 ) -sourcelist_to_parent(drv_sources) \ No newline at end of file +sourcelist_to_parent(drv_sources) diff --git a/src/drivers/mct/shr/glc_elevclass_mod.F90 b/src/drivers/mct/shr/glc_elevclass_mod.F90 index 7ab9f5fdc8f..d68ae8fed2c 100644 --- a/src/drivers/mct/shr/glc_elevclass_mod.F90 +++ b/src/drivers/mct/shr/glc_elevclass_mod.F90 @@ -421,4 +421,3 @@ end function glc_errcode_to_string end module glc_elevclass_mod - diff --git a/src/drivers/mct/shr/seq_flds_mod.F90 b/src/drivers/mct/shr/seq_flds_mod.F90 index e41814a3501..1e13dda0c85 100644 --- a/src/drivers/mct/shr/seq_flds_mod.F90 +++ b/src/drivers/mct/shr/seq_flds_mod.F90 @@ -1351,7 +1351,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call metadata_set(attname, longname, stdname, units) if (trim(cime_model) == 'acme') then - ! Sea ice basal pressure + ! Sea ice basal pressure call seq_flds_add(i2x_states,"Si_bpress") call seq_flds_add(x2o_states,"Si_bpress") longname = 'Sea ice basal pressure' @@ -1361,7 +1361,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call metadata_set(attname, longname, stdname, units) end if - ! Ocean melt and freeze potential + ! Ocean melt and freeze potential call seq_flds_add(o2x_fluxes,"Fioo_q") call seq_flds_add(x2i_fluxes,"Fioo_q") longname = 'Ocean melt and freeze potential' @@ -1419,7 +1419,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) attname = 'Fioi_salt' call metadata_set(attname, longname, stdname, units) - ! Black Carbon hydrophilic deposition + ! Black Carbon hydrophilic deposition call seq_flds_add(i2x_fluxes,"Fioi_bcphi" ) call seq_flds_add(x2o_fluxes,"Fioi_bcphi" ) longname = 'Hydrophylic black carbon deposition flux' @@ -1428,7 +1428,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) attname = 'Fioi_bcphi' call metadata_set(attname, longname, stdname, units) - ! Black Carbon hydrophobic deposition + ! Black Carbon hydrophobic deposition call seq_flds_add(i2x_fluxes,"Fioi_bcpho" ) call seq_flds_add(x2o_fluxes,"Fioi_bcpho" ) longname = 'Hydrophobic black carbon deposition flux' @@ -2514,10 +2514,10 @@ subroutine seq_flds_set(nmlfile, ID, infodata) longname = 'Ratio of ocean surface level abund. HDO/H2O/Rstd' attname = 'So_roce_HDO' call metadata_set(attname, longname, stdname, units) - + + !-------------------------------------------- + !Atmospheric specific humidty at lowest level: !-------------------------------------------- - !Atmospheric specific humidty at lowest level: - !-------------------------------------------- ! specific humidity of H216O at the lowest model level (kg/kg) call seq_flds_add(a2x_states,"Sa_shum_16O") @@ -2547,7 +2547,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) attname = 'Sa_shum_18O' call metadata_set(attname, longname, stdname, units) - ! Surface snow water equivalent (land/atm only) + ! Surface snow water equivalent (land/atm only) call seq_flds_add(l2x_states,"Sl_snowh_16O") call seq_flds_add(l2x_states,"Sl_snowh_18O") call seq_flds_add(l2x_states,"Sl_snowh_HDO") @@ -2572,7 +2572,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) !-------------- !Isotopic Rain: - !-------------- + !-------------- !Isotopic Precipitation Fluxes: units = 'kg m-2 s-1' @@ -2584,15 +2584,15 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(x2i_fluxes, "Faxa_rain_16O") longname = 'Water flux due to H216O rain' !equiv. to bulk stdname = 'H2_16O_rainfall_flux' - attname = 'Faxa_rain_16O' + attname = 'Faxa_rain_16O' call metadata_set(attname, longname, stdname, units) longname = 'H216O Convective precipitation rate' stdname = 'H2_16O_convective_precipitation_flux' - attname = 'Faxa_rainc_16O' + attname = 'Faxa_rainc_16O' call metadata_set(attname, longname, stdname, units) longname = 'H216O Large-scale (stable) precipitation rate' stdname = 'H2_16O_large_scale_precipitation_flux' - attname = 'Faxa_rainl_16O' + attname = 'Faxa_rainl_16O' call metadata_set(attname, longname, stdname, units) call seq_flds_add(a2x_fluxes,"Faxa_rainc_18O") @@ -2603,15 +2603,15 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(x2i_fluxes, "Faxa_rain_18O") longname = 'Water flux due to H218O rain' stdname = 'h2_18o_rainfall_flux' - attname = 'Faxa_rain_18O' + attname = 'Faxa_rain_18O' call metadata_set(attname, longname, stdname, units) longname = 'H218O Convective precipitation rate' stdname = 'H2_18O_convective_precipitation_flux' - attname = 'Faxa_rainc_18O' + attname = 'Faxa_rainc_18O' call metadata_set(attname, longname, stdname, units) longname = 'H218O Large-scale (stable) precipitation rate' stdname = 'H2_18O_large_scale_precipitation_flux' - attname = 'Faxa_rainl_18O' + attname = 'Faxa_rainl_18O' call metadata_set(attname, longname, stdname, units) call seq_flds_add(a2x_fluxes,"Faxa_rainc_HDO") @@ -2622,20 +2622,20 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(x2i_fluxes, "Faxa_rain_HDO") longname = 'Water flux due to HDO rain' stdname = 'hdo_rainfall_flux' - attname = 'Faxa_rain_HDO' + attname = 'Faxa_rain_HDO' call metadata_set(attname, longname, stdname, units) longname = 'HDO Convective precipitation rate' stdname = 'HDO_convective_precipitation_flux' - attname = 'Faxa_rainc_HDO' + attname = 'Faxa_rainc_HDO' call metadata_set(attname, longname, stdname, units) longname = 'HDO Large-scale (stable) precipitation rate' stdname = 'HDO_large_scale_precipitation_flux' - attname = 'Faxa_rainl_HDO' + attname = 'Faxa_rainl_HDO' call metadata_set(attname, longname, stdname, units) !------------- !Isotopic snow: - !------------- + !------------- call seq_flds_add(a2x_fluxes,"Faxa_snowc_16O") call seq_flds_add(a2x_fluxes,"Faxa_snowl_16O") @@ -2645,7 +2645,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(x2i_fluxes, "Faxa_snow_16O") longname = 'Water equiv. H216O snow flux' stdname = 'h2_16o_snowfall_flux' - attname = 'Faxa_snow_16O' + attname = 'Faxa_snow_16O' call metadata_set(attname, longname, stdname, units) longname = 'H2_16O Convective snow rate (water equivalent)' stdname = 'H2_16O_convective_snowfall_flux' @@ -2653,9 +2653,9 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call metadata_set(attname, longname, stdname, units) longname = 'H2_16O Large-scale (stable) snow rate (water equivalent)' stdname = 'H2_16O_large_scale_snowfall_flux' - attname = 'Faxa_snowl_16O' + attname = 'Faxa_snowl_16O' call metadata_set(attname, longname, stdname, units) - + call seq_flds_add(a2x_fluxes,"Faxa_snowc_18O") call seq_flds_add(a2x_fluxes,"Faxa_snowl_18O") call seq_flds_add(x2o_fluxes, "Faxa_snow_18O") @@ -2664,7 +2664,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(x2i_fluxes, "Faxa_snow_18O") longname = 'Isotopic water equiv. snow flux of H218O' stdname = 'h2_18o_snowfall_flux' - attname = 'Faxa_snow_18O' + attname = 'Faxa_snow_18O' call metadata_set(attname, longname, stdname, units) longname = 'H2_18O Convective snow rate (water equivalent)' stdname = 'H2_18O_convective_snowfall_flux' @@ -2672,9 +2672,9 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call metadata_set(attname, longname, stdname, units) longname = 'H2_18O Large-scale (stable) snow rate (water equivalent)' stdname = 'H2_18O_large_scale_snowfall_flux' - attname = 'Faxa_snowl_18O' + attname = 'Faxa_snowl_18O' call metadata_set(attname, longname, stdname, units) - + call seq_flds_add(a2x_fluxes,"Faxa_snowc_HDO") call seq_flds_add(a2x_fluxes,"Faxa_snowl_HDO") call seq_flds_add(x2o_fluxes, "Faxa_snow_HDO") @@ -2683,7 +2683,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(x2i_fluxes, "Faxa_snow_HDO") longname = 'Isotopic water equiv. snow flux of HDO' stdname = 'hdo_snowfall_flux' - attname = 'Faxa_snow_HDO' + attname = 'Faxa_snow_HDO' call metadata_set(attname, longname, stdname, units) longname = 'HDO Convective snow rate (water equivalent)' stdname = 'HDO_convective_snowfall_flux' @@ -2691,12 +2691,12 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call metadata_set(attname, longname, stdname, units) longname = 'HDO Large-scale (stable) snow rate (water equivalent)' stdname = 'HDO_large_scale_snowfall_flux' - attname = 'Faxa_snowl_HDO' + attname = 'Faxa_snowl_HDO' call metadata_set(attname, longname, stdname, units) !---------------------------------- !Isotopic precipitation (rain+snow): - !---------------------------------- + !---------------------------------- call seq_flds_add(x2o_fluxes,"Faxa_prec_16O") ! derived rain+snow longname = 'Isotopic Water flux (rain+snow) for H2_16O' @@ -2779,7 +2779,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) ! H216O Evaporation water flux call seq_flds_add(l2x_fluxes,"Fall_evap_16O") - call seq_flds_add(i2x_fluxes,"Faii_evap_16O") + call seq_flds_add(i2x_fluxes,"Faii_evap_16O") call seq_flds_add(xao_fluxes,"Faox_evap_16O") call seq_flds_add(x2a_fluxes,"Faxx_evap_16O") call seq_flds_add(x2o_fluxes,"Foxx_evap_16O") @@ -2799,7 +2799,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) ! HD16O Evaporation water flux call seq_flds_add(l2x_fluxes,"Fall_evap_HDO") - call seq_flds_add(i2x_fluxes,"Faii_evap_HDO") + call seq_flds_add(i2x_fluxes,"Faii_evap_HDO") call seq_flds_add(xao_fluxes,"Faox_evap_HDO") call seq_flds_add(x2a_fluxes,"Faxx_evap_HDO") call seq_flds_add(x2o_fluxes,"Foxx_evap_HDO") @@ -2815,7 +2815,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) attname = 'Foxx_evap_HDO' call metadata_set(attname, longname, stdname, units) attname = 'Faxx_evap_HDO' - call metadata_set(attname, longname, stdname, units) + call metadata_set(attname, longname, stdname, units) ! H218O Evaporation water flux call seq_flds_add(l2x_fluxes,"Fall_evap_18O") @@ -2828,7 +2828,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) units = 'kg m-2 s-1' attname = 'Fall_evap_18O' call metadata_set(attname, longname, stdname, units) - attname = 'Faii_evap_18O' + attname = 'Faii_evap_18O' call metadata_set(attname, longname, stdname, units) attname = 'Faox_evap_18O' call metadata_set(attname, longname, stdname, units) @@ -2838,7 +2838,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call metadata_set(attname, longname, stdname, units) !----------------------------- - !Isotopic sea ice melting flux: + !Isotopic sea ice melting flux: !----------------------------- ! H216O Water flux from melting @@ -3010,7 +3010,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) ! stdname = 'H2_18O_flodding_water_flux_back_to_land' ! attname = 'Flrr_flood_18O' ! call metadata_set(attname, longname, stdname, units) - + !----------------------------- endif !Water isotopes @@ -3168,7 +3168,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) longname = 'nitrogen deposition flux' stdname = 'nitrogen_deposition' - units = 'kg(N)/m2/sec' + units = 'kg(N)/m2/sec' call metadata_set(ndep_fields, longname, stdname, units) end if @@ -3606,4 +3606,3 @@ subroutine seq_flds_esmf_metadata_get(shortname, longname, stdname, units) end subroutine seq_flds_esmf_metadata_get end module seq_flds_mod - diff --git a/src/drivers/mct/shr/seq_infodata_mod.F90 b/src/drivers/mct/shr/seq_infodata_mod.F90 index 01c6b67689f..86fb0db3518 100644 --- a/src/drivers/mct/shr/seq_infodata_mod.F90 +++ b/src/drivers/mct/shr/seq_infodata_mod.F90 @@ -1455,7 +1455,7 @@ SUBROUTINE seq_infodata_GetData_bytype( component_firstletter, infodata, & write(logunit,*) trim(subname),' Note: ESP type has no resume property' end if end if - + call seq_infodata_GetData(infodata, esp_present=comp_present, & esp_prognostic=comp_prognostic, esp_phase=comp_phase) else @@ -2000,9 +2000,9 @@ SUBROUTINE seq_infodata_PutData_bytype( component_firstletter, infodata, & if (present(comp_resume)) then write(logunit,*) trim(subname),' Note: ESP type has no resume property' end if - + end if - + call seq_infodata_PutData(infodata, esp_present=comp_present, & esp_prognostic=comp_prognostic, esp_phase=comp_phase) else diff --git a/src/drivers/mct/shr/seq_timemgr_mod.F90 b/src/drivers/mct/shr/seq_timemgr_mod.F90 index 04057d72d09..9d1acbecb13 100644 --- a/src/drivers/mct/shr/seq_timemgr_mod.F90 +++ b/src/drivers/mct/shr/seq_timemgr_mod.F90 @@ -4,7 +4,7 @@ ! ! !DESCRIPTION: ! -! A module to create derived types to manage time and clock information +! A module to create derived types to manage time and clock information ! for use with CCSM drivers and models. ! ! !REMARKS: @@ -41,7 +41,7 @@ module seq_timemgr_mod ! --- Clock object methods -------------------------------------------------- public :: seq_timemgr_clockInit ! Setup the sync clock public :: seq_timemgr_clockAdvance ! Advance the sync clock - public :: seq_timemgr_clockPrint ! Print sync clock information + public :: seq_timemgr_clockPrint ! Print sync clock information public :: seq_timemgr_EClockGetData ! Get data from an ESMF clock @@ -64,7 +64,7 @@ module seq_timemgr_mod ! ! PUBLIC PARAMETERS: - integer(SHR_KIND_IN),public :: seq_timemgr_histavg_type + integer(SHR_KIND_IN),public :: seq_timemgr_histavg_type integer(SHR_KIND_IN),public,parameter :: seq_timemgr_type_other = -1 integer(SHR_KIND_IN),public,parameter :: seq_timemgr_type_never = 1 integer(SHR_KIND_IN),public,parameter :: seq_timemgr_type_nhour = 2 @@ -77,14 +77,14 @@ module seq_timemgr_mod ! These are public but declared in the private area for clarity -! clocknames: +! clocknames: ! character(len=*),public,parameter :: & -! seq_timemgr_clock_drv -! seq_timemgr_clock_atm -! seq_timemgr_clock_lnd +! seq_timemgr_clock_drv +! seq_timemgr_clock_atm +! seq_timemgr_clock_lnd ! seq_timemgr_clock_rof -! seq_timemgr_clock_ocn -! seq_timemgr_clock_ice +! seq_timemgr_clock_ocn +! seq_timemgr_clock_ice ! seq_timemgr_clock_glc ! seq_timemgr_clock_wav ! seq_timemgr_clock_esp @@ -92,18 +92,18 @@ module seq_timemgr_mod ! alarmnames: ! character(len=*),public,parameter :: & ! seq_timemgr_alarm_restart -! seq_timemgr_alarm_run -! seq_timemgr_alarm_stop +! seq_timemgr_alarm_run +! seq_timemgr_alarm_stop ! seq_timemgr_alarm_datestop ! seq_timemgr_alarm_history -! seq_timemgr_alarm_atmrun -! seq_timemgr_alarm_lndrun -! seq_timemgr_alarm_rofrun -! seq_timemgr_alarm_ocnrun -! seq_timemgr_alarm_icerun -! seq_timemgr_alarm_glcrun -! seq_timemgr_alarm_glcrun_avg -! seq_timemgr_alarm_wavrun +! seq_timemgr_alarm_atmrun +! seq_timemgr_alarm_lndrun +! seq_timemgr_alarm_rofrun +! seq_timemgr_alarm_ocnrun +! seq_timemgr_alarm_icerun +! seq_timemgr_alarm_glcrun +! seq_timemgr_alarm_glcrun_avg +! seq_timemgr_alarm_wavrun ! seq_timemgr_alarm_esprun ! seq_timemgr_alarm_ocnnext ! seq_timemgr_alarm_tprof @@ -154,7 +154,7 @@ module seq_timemgr_mod integer(SHR_KIND_IN),private,parameter :: max_clocks = 9 character(len=*),public,parameter :: & - seq_timemgr_clock_drv = 'seq_timemgr_clock_drv' , & + seq_timemgr_clock_drv = 'seq_timemgr_clock_drv' , & seq_timemgr_clock_atm = 'seq_timemgr_clock_atm' , & seq_timemgr_clock_lnd = 'seq_timemgr_clock_lnd' , & seq_timemgr_clock_ocn = 'seq_timemgr_clock_ocn' , & @@ -162,7 +162,7 @@ module seq_timemgr_mod seq_timemgr_clock_glc = 'seq_timemgr_clock_glc' , & seq_timemgr_clock_wav = 'seq_timemgr_clock_wav' , & seq_timemgr_clock_rof = 'seq_timemgr_clock_rof' , & - seq_timemgr_clock_esp = 'seq_timemgr_clock_esp' + seq_timemgr_clock_esp = 'seq_timemgr_clock_esp' character(len=8),private,parameter :: seq_timemgr_clocks(max_clocks) = & (/'drv ','atm ','lnd ','ocn ', & 'ice ','glc ','wav ','rof ','esp '/) @@ -223,7 +223,7 @@ module seq_timemgr_mod type(EClock_pointer) :: ECP(max_clocks) ! ESMF clocks, array of pointers type(ESMF_Alarm) :: EAlarm(max_clocks,max_alarms) ! array of clock alarms end type seq_timemgr_type - + ! --- Private local data ---------------------------------------------------- type(ESMF_Calendar), target, save :: seq_timemgr_cal ! calendar @@ -240,17 +240,17 @@ module seq_timemgr_mod !=============================================================================== ! !IROUTINE: seq_timemgr_clockInit -- Initializes clocks -! +! ! !DESCRIPTION: -! +! ! Initializes clock -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_clockInit(SyncClock, nmlfile, restart, restart_file, pioid, mpicom, & EClock_drv, EClock_atm, EClock_lnd, EClock_ocn, EClock_ice, Eclock_glc, & Eclock_rof, EClock_wav, Eclock_esp) - + ! !USES: use pio, only : file_desc_T use shr_file_mod, only : shr_file_getunit, shr_file_freeunit @@ -694,7 +694,7 @@ subroutine seq_timemgr_clockInit(SyncClock, nmlfile, restart, restart_file, pioi endif - ! --- Initialize generic stuff --- + ! --- Initialize generic stuff --- seq_timemgr_calendar = shr_cal_calendarName(calendar) seq_timemgr_esp_run_on_pause = esp_run_on_pause seq_timemgr_end_restart = end_restart @@ -1012,7 +1012,7 @@ subroutine seq_timemgr_clockInit(SyncClock, nmlfile, restart, restart_file, pioi opt_n = dtime(seq_timemgr_nclock_glc), & RefTime = OffsetTime, & alarmname = trim(seq_timemgr_alarm_glcrun_avg)) - else if (glc_avg_period == seq_timemgr_optYearly) then + else if (glc_avg_period == seq_timemgr_optYearly) then call seq_timemgr_alarmInit(SyncClock%ECP(seq_timemgr_nclock_drv)%EClock, & EAlarm = SyncClock%EAlarm(seq_timemgr_nclock_drv,seq_timemgr_nalarm_glcrun_avg), & option = seq_timemgr_optYearly, & @@ -1057,11 +1057,11 @@ end subroutine seq_timemgr_clockInit !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_EClockGetData -- Get information from the clock -! +! ! !DESCRIPTION: -! +! ! Get various values from the clock. -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_EClockGetData( EClock, curr_yr, curr_mon, curr_day, & @@ -1094,7 +1094,7 @@ subroutine seq_timemgr_EClockGetData( EClock, curr_yr, curr_mon, curr_day, & type(ESMF_Time), intent(OUT), optional :: ECurrTime ! Current ESMF time real(SHR_KIND_R8) , intent(OUT), optional :: curr_cday ! current calendar day real(SHR_KIND_R8) , intent(OUT), optional :: next_cday ! current calendar day - real(SHR_KIND_R8) , intent(OUT), optional :: curr_time ! time interval between current time + real(SHR_KIND_R8) , intent(OUT), optional :: curr_time ! time interval between current time ! and reference date real(SHR_KIND_R8) , intent(OUT), optional :: prev_time ! time interval between previous time ! and reference date @@ -1163,7 +1163,7 @@ subroutine seq_timemgr_EClockGetData( EClock, curr_yr, curr_mon, curr_day, & endif ! ---Current Time (the time interval between the current date and the reference date) --- - if ( present(curr_time)) then + if ( present(curr_time)) then timediff = CurrentTime - RefTime call ESMF_TimeIntervalGet(timediff, d=days, s=seconds, rc=rc) call seq_timemgr_ESMFCodeCheck( rc, msg=subname//"Error from TimeIntervalGet timediff") @@ -1171,7 +1171,7 @@ subroutine seq_timemgr_EClockGetData( EClock, curr_yr, curr_mon, curr_day, & end if ! ---Previous Time (the time interval between the previous date and the reference date) --- - if ( present(prev_time)) then + if ( present(prev_time)) then timediff = PreviousTime - RefTime call ESMF_TimeIntervalGet(timediff, d=days, s=seconds, rc=rc) call seq_timemgr_ESMFCodeCheck( rc, msg=subname//"Error from TimeIntervalGet timediff") @@ -1210,11 +1210,11 @@ end subroutine seq_timemgr_EClockGetData !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_clockAdvance -- Advance the syncclock -! +! ! !DESCRIPTION: -! +! ! Advance this clock -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_clockAdvance( SyncClock, force_stop, force_stop_ymd, force_stop_tod ) @@ -1230,7 +1230,7 @@ subroutine seq_timemgr_clockAdvance( SyncClock, force_stop, force_stop_ymd, forc !----- local ----- character(len=*), parameter :: subname = '(seq_timemgr_clockAdvance) ' - integer :: n + integer :: n type(ESMF_Time) :: NextAlarm ! Next restart alarm time integer :: rc ! Return code @@ -1331,11 +1331,11 @@ end subroutine seq_timemgr_clockAdvance !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_alarmInit -- Set an alarm -! +! ! !DESCRIPTION: -! +! ! Setup an alarm in a clock -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_alarmInit( EClock, EAlarm, option, opt_n, opt_ymd, opt_tod, RefTime, alarmname) @@ -1369,7 +1369,7 @@ subroutine seq_timemgr_alarmInit( EClock, EAlarm, option, opt_n, opt_ymd, opt_to !------------------------------------------------------------------------------- ! Notes: This is slightly screwed up because of the way the ESMF alarm ! initializes. The ringtime sent to AlarmCreate MUST be the next -! alarm time. If you send an arbitrary but proper ringtime from +! alarm time. If you send an arbitrary but proper ringtime from ! the past and the ring interval, the alarm will always go off on ! the next clock advance and this will cause serious problems. ! So, even if it makes sense to initialize an alarm with some @@ -1410,21 +1410,21 @@ subroutine seq_timemgr_alarmInit( EClock, EAlarm, option, opt_n, opt_ymd, opt_to selectcase (trim(option)) case (seq_timemgr_optNONE) - !--- tcx seems we need an alarm interval or the alarm create fails, + !--- tcx seems we need an alarm interval or the alarm create fails, !--- problem in esmf_wrf_timemgr? call ESMF_TimeIntervalSet(AlarmInterval, yy=9999, rc=rc) call ESMF_TimeSet( NextAlarm, yy=9999, mm=12, dd=1, s=0, calendar=seq_timemgr_cal, rc=rc ) update_nextalarm = .false. case (seq_timemgr_optNever) - !--- tcx seems we need an alarm interval or the alarm create fails, + !--- tcx seems we need an alarm interval or the alarm create fails, !--- problem in esmf_wrf_timemgr? call ESMF_TimeIntervalSet(AlarmInterval, yy=9999, rc=rc) call ESMF_TimeSet( NextAlarm, yy=9999, mm=12, dd=1, s=0, calendar=seq_timemgr_cal, rc=rc ) update_nextalarm = .false. case (seq_timemgr_optDate) - !--- tcx seems we need an alarm interval or the alarm create fails, + !--- tcx seems we need an alarm interval or the alarm create fails, !--- problem in esmf_wrf_timemgr? call ESMF_TimeIntervalSet(AlarmInterval, yy=9999, rc=rc) if (.not. present(opt_ymd)) call shr_sys_abort(subname//trim(option)//' requires opt_ymd') @@ -1570,11 +1570,11 @@ end subroutine seq_timemgr_AlarmInit !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_alarmGet -- Get information from the alarm -! +! ! !DESCRIPTION: -! +! ! Get various values from the alarm. -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_alarmGet( EAlarm, next_ymd, next_tod, prev_ymd, prev_tod, & @@ -1643,11 +1643,11 @@ end subroutine seq_timemgr_alarmGet !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_alarmSetOn -- turn alarm on -! +! ! !DESCRIPTION: -! +! ! turn alarm on -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_AlarmSetOn( EClock, alarmname) @@ -1676,8 +1676,8 @@ subroutine seq_timemgr_AlarmSetOn( EClock, alarmname) ! and the alarm pointer is valid if it's associated. If it's not associated ! the AlarmGet calls will generally return an error code. What we really ! want is to ignore the unset alarms. So below, we have to kind of kludge -! this up. We set name=xalarm, a special value, before the AlarmGet call so -! if Alarm_list(n) is not associated, the name will remain the value of +! this up. We set name=xalarm, a special value, before the AlarmGet call so +! if Alarm_list(n) is not associated, the name will remain the value of ! xalarm. Then we check whether it's a valid alarm by first checking ! the name vs xalarm. If name is not xalarm, then it must be a valid alarm ! and we either set found to true if we are setting all alarms or we compare @@ -1724,11 +1724,11 @@ end subroutine seq_timemgr_AlarmSetOn !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_alarmSetOff -- turn alarm off -! +! ! !DESCRIPTION: -! +! ! turn alarm off -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_AlarmSetOff( EClock, alarmname) @@ -1757,8 +1757,8 @@ subroutine seq_timemgr_AlarmSetOff( EClock, alarmname) ! and the alarm pointer is valid if it's associated. If it's not associated ! the AlarmGet calls will generally return an error code. What we really ! want is to ignore the unset alarms. So below, we have to kind of kludge -! this up. We set name=xalarm, a special value, before the AlarmGet call so -! if Alarm_list(n) is not associated, the name will remain the value of +! this up. We set name=xalarm, a special value, before the AlarmGet call so +! if Alarm_list(n) is not associated, the name will remain the value of ! xalarm. Then we check whether it's a valid alarm by first checking ! the name vs xalarm. If name is not xalarm, then it must be a valid alarm ! and we either set found to true if we are setting all alarms or we compare @@ -1805,11 +1805,11 @@ end subroutine seq_timemgr_AlarmSetOff !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_alarmIsOn -- check if an alarm is ringing -! +! ! !DESCRIPTION: -! +! ! check if an alarm is ringing -! +! ! !INTERFACE: ------------------------------------------------------------------ logical function seq_timemgr_alarmIsOn( EClock, alarmname) @@ -1885,11 +1885,11 @@ end function seq_timemgr_alarmIsOn !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_restartAlarmIsOn -- check if an alarm is ringing -! +! ! !DESCRIPTION: -! +! ! check if an alarm is ringing -! +! ! !INTERFACE: ------------------------------------------------------------------ logical function seq_timemgr_restartAlarmIsOn( EClock) @@ -1915,11 +1915,11 @@ end function seq_timemgr_restartAlarmIsOn !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_stopAlarmIsOn -- check if an alarm is ringing -! +! ! !DESCRIPTION: -! +! ! check if an alarm is ringing -! +! ! !INTERFACE: ------------------------------------------------------------------ logical function seq_timemgr_stopAlarmIsOn( EClock) @@ -1945,11 +1945,11 @@ end function seq_timemgr_stopAlarmIsOn !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_historyAlarmIsOn -- check if an alarm is ringing -! +! ! !DESCRIPTION: -! +! ! check if an alarm is ringing -! +! ! !INTERFACE: ------------------------------------------------------------------ logical function seq_timemgr_historyAlarmIsOn( EClock) @@ -1975,11 +1975,11 @@ end function seq_timemgr_historyAlarmIsOn !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_pauseAlarmIsOn -- check if an alarm is ringing -! +! ! !DESCRIPTION: -! +! ! check if an alarm is ringing -! +! ! !INTERFACE: ------------------------------------------------------------------ logical function seq_timemgr_pauseAlarmIsOn( EClock) @@ -2007,11 +2007,11 @@ end function seq_timemgr_pauseAlarmIsOn !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_pause_active -- Is pause/resume active this run? -! +! ! !DESCRIPTION: -! +! ! Return .true. if any component is configured for pause/resume -! +! ! !INTERFACE: ------------------------------------------------------------------ logical function seq_timemgr_pause_active() @@ -2031,11 +2031,11 @@ end function seq_timemgr_pause_active !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_pause_component_index -- return an index for a component -! +! ! !DESCRIPTION: -! +! ! Look up a component's internal index for faster processing -! +! ! !INTERFACE: ------------------------------------------------------------------ integer function seq_timemgr_pause_component_index(component_name) @@ -2074,11 +2074,11 @@ end function seq_timemgr_pause_component_index !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_pause_component_active -- Check if component paused -! +! ! !DESCRIPTION: -! +! ! Return .true. if component is active in driver pause -! +! ! !INTERFACE: ------------------------------------------------------------------ logical function seq_timemgr_pause_component_active(component_index) @@ -2106,13 +2106,13 @@ end function seq_timemgr_pause_component_active !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_ETimeInit -- Create ESMF_Time object based on YMD values -! +! ! !DESCRIPTION: -! +! ! Create the ESMF_Time object corresponding to the given input time, given in ! YMD (Year Month Day) and TOD (Time-of-day) format. ! Set the time by an integer as YYYYMMDD and integer seconds in the day -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_ETimeInit( ETime, ymd, tod, desc ) @@ -2165,11 +2165,11 @@ end subroutine seq_timemgr_ETimeInit !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_ETimeGet -- Get the date in YYYYMMDD from from ESMF Time -! +! ! !DESCRIPTION: -! +! ! Get the date in YYYYMMDD format from a ESMF time object. -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_ETimeGet( ETime, offset, ymd, tod ) @@ -2230,13 +2230,13 @@ end subroutine seq_timemgr_ETimeGet !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_EClockInit -- Initialize the ESMF clock in the shared clock -! +! ! !DESCRIPTION: -! +! ! Private method: ! ! Setup the ESMF clock inside the wrapped CCSM clock -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_EClockInit( TimeStep, StartTime, RefTime, CurrTime, EClock ) @@ -2294,11 +2294,11 @@ end subroutine seq_timemgr_EClockInit !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_EClockDateInSync -- Check that input date in sync with clock -! +! ! !DESCRIPTION: -! +! ! Check that the given input date/time is in sync with clock time -! +! ! !INTERFACE: ------------------------------------------------------------------ logical function seq_timemgr_EClockDateInSync( EClock, ymd, tod, prev) @@ -2349,11 +2349,11 @@ end function seq_timemgr_EClockDateInSync !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_clockPrint -- Print clock information out -! +! ! !DESCRIPTION: -! +! ! Print clock information out. -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_clockPrint( SyncClock ) @@ -2450,11 +2450,11 @@ end subroutine seq_timemgr_clockPrint !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_ESMFDebug -- Print ESMF stuff for debugging -! +! ! !DESCRIPTION: -! +! ! Print ESMF stuff for debugging -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_ESMFDebug( EClock, ETime, ETimeInterval, istring ) @@ -2522,11 +2522,11 @@ end subroutine seq_timemgr_ESMFDebug !=============================================================================== !=============================================================================== ! !IROUTINE: seq_timemgr_ESMFCodeCheck -- Check return-code from ESMF -- abort if not -! +! ! !DESCRIPTION: -! +! ! Check ESMF return code and abort if not successful. -! +! ! !INTERFACE: ------------------------------------------------------------------ subroutine seq_timemgr_ESMFCodeCheck( rc, msg ) diff --git a/src/drivers/mct/shr/shr_ndep_mod.F90 b/src/drivers/mct/shr/shr_ndep_mod.F90 index d7ac81459da..f1d602a34fc 100644 --- a/src/drivers/mct/shr/shr_ndep_mod.F90 +++ b/src/drivers/mct/shr/shr_ndep_mod.F90 @@ -100,7 +100,7 @@ subroutine shr_ndep_readnl(NLFilename, ID, ndep_fields, add_ndep_fields) if (len_trim(ndep_list(1)) == 0) then add_ndep_fields = .false. else - ! Loop over species to fill list of fields to communicate for ndep + ! Loop over species to fill list of fields to communicate for ndep add_ndep_fields = .true. do i=1,maxspc if ( len_trim(ndep_list(i))==0 ) exit