Skip to content

Commit 3720fba

Browse files
mlee03mlee03
authored andcommitted
ci
1 parent 5d57295 commit 3720fba

File tree

1 file changed

+58
-48
lines changed

1 file changed

+58
-48
lines changed

full/atm_land_ice_flux_exchange.F90

Lines changed: 58 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ module atm_land_ice_flux_exchange_mod
223223
id_t_atm, & !< diag_manager register field id for temperature at lowest atmospheric level
224224
id_t_ca, & !< diag_manager register field id for canopy air temperature
225225
id_t_flux, & !< diag_manager register field id for sensible heat flux
226+
id_t_flux_land, & !< diag_manager register field id for sensible heat flux
226227
id_t_ocean, & !< diag_manager register field id for surface temperature from ocean output
227228
id_t_ref, & !< diag_manager register field id for temperature at z_ref_heat
228229
id_t_ref_land, & !< diag_manager register field id for temperature at z_ref_heat over land
@@ -244,7 +245,7 @@ module atm_land_ice_flux_exchange_mod
244245
id_wind_ref, & !< diag_manager register field id for absolute value of wind at z_ref_mom
245246
id_z_atm, & !< diag_manager register field id for height of lowest atmospheric level
246247
id_co2_atm_dvmr, & !< diag_manager register field id for co2 dry volume mixing ratio at lowest atmospheric level
247-
id_co2_surf_dvmr & !< diag_manager register field id for c02 dry volume mixing ratio at surface
248+
id_co2_surf_dvmr, & !< diag_manager register field id for c02 dry volume mixing ratio at surface
248249
! 2017/08/15 jgj added
249250
id_co2_bot, & !< diag_manager register field id for concentration of co2 to be passed to land/photosynthesis
250251
id_co2_flux_pcair_atm, & !< diag_manager register field id for concentration of co2 to be passed to ocean
@@ -259,12 +260,15 @@ module atm_land_ice_flux_exchange_mod
259260
id_tr_ref(:), & !< diag_manager register field id value of tracer at z_ref_heat
260261
id_tr_ref_land(:), & !< diag_manager register field id tracer flux at z_ref_heat over land NEED HELP
261262
!f1p
262-
id_tr_mol_flux0(:), & !< diag_manager register field id gross flux of tracer concentration over land in [mol/m2*s]
263+
id_tr_mol_flux0(:), &
264+
!< diag_manager register field id gross flux of tracer concentration over land in [mol/m2*s]
263265
id_tr_flux_land(:), & !< diag_manager register field id flux of tracer concentration over land in [kg/m2*s]
264-
id_tr_mol_flux_land(:), & !< diag_manager register field id flux of tracer concentration over land in [mol/m2*s]
266+
id_tr_mol_flux_land(:), &
267+
!< diag_manager register field id flux of tracer concentration over land in [mol/m2*s]
265268
! used with _USE_LEGACY_LAND_
266269
id_tr_con_atm(:), & !< diag_manager register field id deposition velocity at lowest atmospheric level (atm)
267-
id_tr_con_atm_land(:), & !< diag_manager register field id deposition velocity at lowest atmospheric level over land
270+
id_tr_con_atm_land(:), &
271+
!< diag_manager register field id deposition velocity at lowest atmospheric level over land
268272
id_tr_con_ref(:), & !< diag_manager register field id deposition velocity at reference height (atm)
269273
id_tr_con_ref_land(:) !< diag_manager register field id deposition velocity at reference height over land
270274

@@ -345,6 +349,7 @@ module atm_land_ice_flux_exchange_mod
345349
ex_dhdt_atm, & !< d(sens.heat.flux)/d(T atm) on the exchange grid
346350
ex_dhdt_surf, & !< d(sens.heat.flux)/d(T canopy) on the exchange grid
347351
ex_dqsatdt_surf, & !< d(water.vap.flux)/d(q canopy) on the exchange grid
352+
ex_drag_q, & !< q drag coefficient on the exchange grid
348353
ex_drdt_surf, & !< d(LW flux)/d(T surf) on the exchange grid
349354
ex_dtaudu_atm, & !< d(stress)/d(u) on the exchange grid
350355
ex_dtaudv_atm, & !< d(stress)/d(v) on the exchange grid
@@ -515,6 +520,7 @@ subroutine atm_land_ice_flux_exchange_init(Time, Atm, Land, Ice, atmos_ice_bound
515520
!! the atmosphere and ocean. Values defined from the field table or computed during model run
516521

517522
character(len=48), parameter :: module_name = 'atm_land_ice_flux_exchange_mod'
523+
character(len=64), parameter :: sub_name = 'atm_land_ice_flux_init'
518524
character(len=256), parameter :: &
519525
note_header = '==>Note from ' // trim(module_name) // '(' // trim(sub_name) // '):'
520526

@@ -558,8 +564,8 @@ subroutine atm_land_ice_flux_exchange_init(Time, Atm, Land, Ice, atmos_ice_bound
558564

559565
allocate(block_start(nblocks), block_end(nblocks))
560566

561-
!> FROM THE TRACER TABLE, GET THE TOTAL NUMBER TRACERS, TOTAL NUMBER OF SPECIFIC HUMIDITY TRACER, AND TOTAL NUMBER PROGNOSTIC TRACERS
562-
!! IN ATMOSPHERE AND LAND MODELS
567+
!> FROM THE TRACER TABLE, GET THE TOTAL NUMBER TRACERS,
568+
!! TOTAL NUMBER OF SPECIFIC HUMIDITY TRACER, AND TOTAL NUMBER PROGNOSTIC TRACERS IN ATMOSPHERE AND LAND MODELS
563569
!{
564570
call fms_tracer_manager_get_number_tracers(MODEL_ATMOS, num_tracers=n_atm_tr_tot, num_prog=n_atm_tr)
565571
call fms_tracer_manager_get_number_tracers(MODEL_LAND, num_tracers=n_lnd_tr_tot, num_prog=n_lnd_tr)
@@ -919,7 +925,7 @@ subroutine sfc_boundary_layer (dt, Time, Atm, Land, Ice, Land_Ice_Atmos_Boundary
919925

920926
logical :: used !< returned value from data_override. if true, data was overwritten
921927
character(32) :: &
922-
tr_name, !< tracer name
928+
tr_name, & !< tracer name
923929
tr_units !< tracer id
924930

925931
integer :: tr, n, m ! tracer indices
@@ -948,17 +954,17 @@ subroutine sfc_boundary_layer (dt, Time, Atm, Land, Ice, Land_Ice_Atmos_Boundary
948954
ex_t_surf(n_xgrid_sfc), &
949955
ex_t_surf_miz(n_xgrid_sfc), &
950956
ex_p_surf(n_xgrid_sfc), &
951-
ex_slp(n_xgrid_sfc), &
952-
ex_t_ca(n_xgrid_sfc), &
953-
ex_dhdt_surf(n_xgrid_sfc), &
954-
ex_dedt_surf(n_xgrid_sfc), &
957+
ex_slp(n_xgrid_sfc), &
958+
ex_t_ca(n_xgrid_sfc), &
959+
ex_dhdt_surf(n_xgrid_sfc), &
960+
ex_dedt_surf(n_xgrid_sfc), &
955961
ex_dqsatdt_surf(n_xgrid_sfc), &
956-
ex_drdt_surf(n_xgrid_sfc), &
957-
ex_dhdt_atm(n_xgrid_sfc), &
958-
ex_flux_t(n_xgrid_sfc), &
959-
ex_flux_lw(n_xgrid_sfc), &
960-
ex_drag_q(n_xgrid_sfc), &
961-
ex_avail(n_xgrid_sfc), &
962+
ex_drdt_surf(n_xgrid_sfc), &
963+
ex_dhdt_atm(n_xgrid_sfc), &
964+
ex_flux_t(n_xgrid_sfc), &
965+
ex_flux_lw(n_xgrid_sfc), &
966+
ex_drag_q(n_xgrid_sfc), &
967+
ex_avail(n_xgrid_sfc), &
962968
ex_f_t_delt_n(n_xgrid_sfc), &
963969
ex_tr_surf(n_xgrid_sfc, n_exch_tr), &
964970
ex_dfdtr_surf(n_xgrid_sfc, n_exch_tr), &
@@ -1389,14 +1395,15 @@ subroutine sfc_boundary_layer (dt, Time, Atm, Land, Ice, Land_Ice_Atmos_Boundary
13891395
is=block_start(l)
13901396
ie=block_end(l)
13911397
call surface_flux (&
1392-
ex_t_atm(is:ie), ex_tr_atm(is:ie,isphum), ex_u_atm(is:ie), ex_v_atm(is:ie), ex_p_atm(is:ie), ex_z_atm(is:ie),&
1393-
ex_p_surf(is:ie),ex_t_surf(is:ie), ex_t_ca(is:ie), ex_tr_surf(is:ie,isphum), ex_u_surf(is:ie), ex_v_surf(is:ie), &
1394-
ex_rough_mom(is:ie), ex_rough_heat(is:ie), ex_rough_moist(is:ie), ex_rough_scale(is:ie), ex_gust(is:ie), &
1395-
ex_flux_t(is:ie), ex_flux_tr(is:ie,isphum), ex_flux_lw(is:ie), ex_flux_u(is:ie), ex_flux_v(is:ie), &
1396-
ex_cd_m(is:ie), ex_cd_t(is:ie), ex_cd_q(is:ie), ex_wind(is:ie), ex_u_star(is:ie), ex_b_star(is:ie), &
1397-
ex_q_star(is:ie), ex_thv_atm(is:ie), ex_thv_surf(is:ie), ex_dhdt_surf(is:ie), ex_dedt_surf(is:ie), &
1398-
ex_dfdtr_surf(is:ie,isphum), ex_drdt_surf(is:ie), ex_dhdt_atm(is:ie), ex_dfdtr_atm(is:ie,isphum), &
1399-
ex_dtaudu_atm(is:ie), ex_dtaudv_atm(is:ie), dt, ex_land(is:ie), (ex_seawater(is:ie).gt.0.0), ex_avail(is:ie))
1398+
ex_t_atm(is:ie), ex_tr_atm(is:ie,isphum), ex_u_atm(is:ie), ex_v_atm(is:ie), ex_p_atm(is:ie), &
1399+
ex_z_atm(is:ie), ex_p_surf(is:ie),ex_t_surf(is:ie), ex_t_ca(is:ie), ex_tr_surf(is:ie,isphum), &
1400+
ex_u_surf(is:ie), ex_v_surf(is:ie), ex_rough_mom(is:ie), ex_rough_heat(is:ie), ex_rough_moist(is:ie), &
1401+
ex_rough_scale(is:ie), ex_gust(is:ie), ex_flux_t(is:ie), ex_flux_tr(is:ie,isphum), ex_flux_lw(is:ie), &
1402+
ex_flux_u(is:ie), ex_flux_v(is:ie), ex_cd_m(is:ie), ex_cd_t(is:ie), ex_cd_q(is:ie), ex_wind(is:ie), &
1403+
ex_u_star(is:ie), ex_b_star(is:ie), ex_q_star(is:ie), ex_thv_atm(is:ie), ex_thv_surf(is:ie), &
1404+
ex_dhdt_surf(is:ie), ex_dedt_surf(is:ie), ex_dfdtr_surf(is:ie,isphum), ex_drdt_surf(is:ie), &
1405+
ex_dhdt_atm(is:ie), ex_dfdtr_atm(is:ie,isphum), ex_dtaudu_atm(is:ie), ex_dtaudv_atm(is:ie), &
1406+
dt, ex_land(is:ie), (ex_seawater(is:ie).gt.0.0), ex_avail(is:ie))
14001407
enddo
14011408

14021409
#ifdef SCM
@@ -1794,8 +1801,8 @@ subroutine sfc_boundary_layer (dt, Time, Atm, Land, Ice, Land_Ice_Atmos_Boundary
17941801
endif
17951802
!}
17961803

1797-
!> MAP ATMOSPHERIC DATA FROM THE EXCHANGE GRID TO THE ATM GRID AND SEND DATA TO DIAG_MANAGER BUFFER FOR DIAGNOSTIC OUTPUT.
1798-
!! NOTE, DATA WILL ONLY BE OUTPUTTED IF VARIABLE SPECIFICATION IS FOUND IN DIAG_TABLE.YAML
1804+
!> MAP ATMOSPHERIC DATA FROM THE EXCHANGE GRID TO THE ATM GRID AND SEND DATA TO DIAG_MANAGER BUFFER
1805+
!! FOR DIAGNOSTIC OUTPUT. NOTE, DATA WILL ONLY BE OUTPUTTED IF VARIABLE SPECIFICATION IS FOUND IN DIAG_TABLE.YAML
17991806
!{
18001807
do n = 1, Atm%fields%num_bcs
18011808
do m = 1, Atm%fields%bc(n)%num_fields
@@ -2206,13 +2213,15 @@ end subroutine sfc_boundary_layer
22062213
!> Subroutine flux_down_from_atmos corrects fluxes to land and ice
22072214
!! for the implicit treatment of atmospheric diffisuve fluxes
22082215
!! The subroutine also computes stock exchanges between the components
2209-
subroutine flux_down_from_atmos(Time, Atm, Atmos_boundary, Land_boundary, Ice_boundary)
2216+
subroutine flux_down_from_atmos(Time, Atm, Land, Ice, Atmos_boundary, Land_boundary, Ice_boundary)
22102217

22112218
implicit none
22122219
type(FmsTime_type), intent(in):: Time
22132220
!< Current model time
22142221
type(atmos_data_type), intent(inout) :: Atm
2215-
!< A derived data type holding atmosphere boundary data
2222+
!< A derived data type holding atmosphere boundary data
2223+
type(land_data_type), intent(in) :: Land !< A derived data type holding land boundary data
2224+
type(ice_data_type), intent(in) :: Ice !< A derived data type holding ice boundary data
22162225
type(land_ice_atmos_boundary_type), intent(in) :: Atmos_boundary
22172226
!< A derived data type to specify properties and fluxes passed from exchange grid to the atmosphere land and ice
22182227
type(atmos_land_boundary_type), intent(inout):: Land_boundary
@@ -2245,8 +2254,10 @@ subroutine flux_down_from_atmos(Time, Atm, Atmos_boundary, Land_boundary, Ice_bo
22452254
ex_dsetl_dtr ! derivative of setl_flux w.r.t. tracer concentration
22462255
#endif
22472256

2248-
real :: setl_flux(size(Atm%tr_bot,1),size(Atm%tr_bot,2)) ! tracer seditation flux from the lowest atmospehere layer on the atm grid
2249-
real :: dsetl_dtr(size(Atm%tr_bot,1),size(Atm%tr_bot,2)) ! derivative of setl_dtr from the lowest atmosphere layer on the atm grid
2257+
real :: setl_flux(size(Atm%tr_bot,1),size(Atm%tr_bot,2))
2258+
!< tracer seditation flux from the lowest atmospehere layer on the atm grid
2259+
real :: dsetl_dtr(size(Atm%tr_bot,1),size(Atm%tr_bot,2))
2260+
!< derivative of setl_dtr from the lowest atmosphere layer on the atm grid
22502261

22512262
! temporary arrays
22522263
real, dimension(n_xgrid_sfc) :: ex_gamma, ex_dtmass, ex_delta_t, ex_delta_u, ex_delta_v, ex_dflux_t
@@ -2258,7 +2269,8 @@ subroutine flux_down_from_atmos(Time, Atm, Atmos_boundary, Land_boundary, Ice_bo
22582269
ex_dflux_tr ! tracer flux change
22592270

22602271
real :: cp_inv ! inverse heat capacity at constant pressure
2261-
logical :: used, ov, ier ! used in calls to fms
2272+
logical :: used, ov ! used in calls to fms
2273+
integer :: ier ! used in calls to fms
22622274
integer :: is_atm, ie_atm, js_atm, je_atm, j ! do loop indices
22632275

22642276
character(32) :: tr_name ! name of the tracer
@@ -2764,12 +2776,11 @@ subroutine flux_down_from_atmos(Time, Atm, Atmos_boundary, Land_boundary, Ice_bo
27642776
call fms_coupler_type_send_data(Ice_boundary%fluxes, Time)
27652777
!} end override Ice fields
27662778

2767-
!> COMPUTE STOCK CHANGES BETWEEN COMPONENTS
2768-
!{
2779+
!> COMPUTE STOCK CHANGES BETWEEN COMPONENTS
27692780
! Atm -> Lnd (precip)
27702781
call FMS_XGRID_STOCK_MOVE_( &
2771-
& FROM = fms_stock_constants_atm_stock(ISTOCK_WATER), &
2772-
& TO = fms_stock_constants_lnd_stock(ISTOCK_WATER), &
2782+
& FROM = fms_stock_constants_atm_stock(ISTOCK_WATER), &
2783+
& TO = fms_stock_constants_lnd_stock(ISTOCK_WATER), &
27732784
#ifndef _USE_LEGACY_LAND_
27742785
& stock_ug_data3d = (Land_boundary%lprec + Land_boundary%fprec), &
27752786
#else
@@ -2784,24 +2795,23 @@ subroutine flux_down_from_atmos(Time, Atm, Atmos_boundary, Land_boundary, Ice_bo
27842795
! Atm -> Lnd (heat)
27852796
call FMS_XGRID_STOCK_MOVE_( &
27862797
& FROM = fms_stock_constants_atm_stock(ISTOCK_HEAT), &
2787-
& TO = fms_stock_constants_lnd_stock(ISTOCK_HEAT), &
2798+
& TO = fms_stock_constants_lnd_stock(ISTOCK_HEAT), &
27882799
#ifndef _USE_LEGACY_LAND_
27892800
& stock_ug_data3d = &
2790-
(-Land_boundary%t_flux + Land_boundary%lw_flux + Land_boundary%sw_flux - Land_boundary%fprec*HLF), &
2801+
(-Land_boundary%t_flux + Land_boundary%lw_flux + Land_boundary%sw_flux - Land_boundary%fprec*HLF), &
27912802
#else
27922803
& stock_data3d = &
2793-
(-Land_boundary%t_flux + Land_boundary%lw_flux + Land_boundary%sw_flux - Land_boundary%fprec*HLF), &
2794-
#endif
2804+
(-Land_boundary%t_flux + Land_boundary%lw_flux + Land_boundary%sw_flux - Land_boundary%fprec*HLF), &
2805+
#endif
27952806
& grid_index=X1_GRID_LND, &
27962807
& xmap=xmap_sfc, &
27972808
& delta_t=Dt_atm, &
27982809
& from_side=ISTOCK_BOTTOM, to_side=ISTOCK_TOP, &
27992810
& radius=Radius, ier=ier, verbose='stock move HEAT (Atm->Lnd) ')
2800-
28012811
! Atm -> Ice (precip)
28022812
call fms_xgrid_stock_move( &
28032813
& FROM = fms_stock_constants_atm_stock(ISTOCK_WATER), &
2804-
& TO = fms_stock_constants_ice_stock(ISTOCK_WATER), &
2814+
& TO = fms_stock_constants_ice_stock(ISTOCK_WATER), &
28052815
& stock_data3d = (Ice_boundary%lprec + Ice_boundary%fprec), &
28062816
& grid_index=X1_GRID_ICE, &
28072817
& xmap=xmap_sfc, &
@@ -2812,17 +2822,17 @@ subroutine flux_down_from_atmos(Time, Atm, Atmos_boundary, Land_boundary, Ice_bo
28122822
! Atm -> Ice (heat)
28132823
call fms_xgrid_stock_move( &
28142824
& FROM = fms_stock_constants_atm_stock(ISTOCK_HEAT), &
2815-
& TO = fms_stock_constants_ice_stock(ISTOCK_HEAT), &
2816-
& stock_data3d = &
2817-
(-Ice_boundary%t_flux + Ice_boundary%lw_flux - Ice_boundary%fprec*HLF + Ice_boundary%sw_flux_vis_dir + &
2825+
& TO = fms_stock_constants_ice_stock(ISTOCK_HEAT), &
2826+
& stock_data3d = (-Ice_boundary%t_flux + Ice_boundary%lw_flux - Ice_boundary%fprec*HLF + &
2827+
Ice_boundary%sw_flux_vis_dir + &
28182828
Ice_boundary%sw_flux_vis_dif + Ice_boundary%sw_flux_nir_dir + Ice_boundary%sw_flux_nir_dif), &
28192829
& grid_index=X1_GRID_ICE, &
28202830
& xmap=xmap_sfc, &
28212831
& delta_t=Dt_atm, &
28222832
& from_side=ISTOCK_BOTTOM, to_side=ISTOCK_TOP, &
28232833
& radius=Radius, ier=ier, verbose='stock move HEAT (Atm->Ice) ')
2824-
!} END COPUTE STOCK EXCHANGE BETWEEN COMPONENTS
2825-
2834+
!} END COMPUTE STOCK EXCHANGE
2835+
28262836
deallocate(ex_flux_u, ex_flux_v, ex_dtaudu_atm, ex_dtaudv_atm)
28272837

28282838

@@ -3908,7 +3918,7 @@ subroutine diag_field_init(Time, atmos_axes, land_axes, land_pe)
39083918
! 'nh3 flux out of the ocean assuming not nh3 in the atmosphere', 'mol/m2/s')
39093919

39103920

3911-
id_q_flux = fms_diag_register_diag_field(mod_name, 'evap',fatmos_axes, Time, &
3921+
id_q_flux = fms_diag_register_diag_field(mod_name, 'evap', atmos_axes, Time, &
39123922
'evaporation rate', 'kg/m2/s')
39133923

39143924
!--------------------------------------------------------------------

0 commit comments

Comments
 (0)