@@ -74,7 +74,7 @@ module hs_forcing_mod
74
74
real :: local_heating_latwidth= 0.4 ! radians latitude Used only when local_heating_option='Gaussian'
75
75
real :: local_heating_sigwidth= 0.11 ! sigma height Used only when local_heating_option='Gaussian'
76
76
real :: local_heating_sigcenter= 0.3 ! sigma height Used only when local_heating_option='Gaussian'
77
- logical :: polar_heating_option= .false. ! want to add some heating over the pole?
77
+ logical :: polar_heating_option= .false. ! want to add some heating over the pole?
78
78
real :: polar_heating_srfamp= 0.0 ! Degrees per day Used only when polar heating_option='true'
79
79
real :: polar_heating_latwidth= 0.0 ! radians latitude Used only when polar_heating_option='true'
80
80
real :: polar_heating_latcenter= 0.0 ! radians latitude Used only when polar_heating_option='true'
@@ -150,7 +150,7 @@ module hs_forcing_mod
150
150
equilibrium_tau_option,equilibrium_tau_file, & ! mj
151
151
p_hs,p_bd,A_NH_0,A_NH_1,A_SH_0,A_SH_1,A_s, & ! mj
152
152
phi_N,phi_S,tau_t,tau_N_p,tau_S_p,delta_phi, & ! mj
153
- Te_fact ,tau_fact, & ! mj
153
+ T_fact ,tau_fact, & ! mj
154
154
tau_m,do_seasonal_cycle,days_per_year ! mj
155
155
156
156
!- ----------------------------------------------------------------------
@@ -276,7 +276,7 @@ subroutine hs_forcing ( is, ie, js, je, dt, Time, lon, lat, p_half, p_full, &
276
276
call get_number_tracers(MODEL_ATMOS, num_tracers= num_tracers)
277
277
n_hum = get_tracer_index(MODEL_ATMOS, ' sphum' ) ! mj
278
278
n_pv = get_tracer_index(MODEL_ATMOS, ' pv' ) ! mj
279
-
279
+
280
280
if (num_tracers == size (rdt,4 )) then
281
281
do n = 1 , size (rdt,4 )
282
282
flux = trflux
@@ -293,12 +293,12 @@ subroutine hs_forcing ( is, ie, js, je, dt, Time, lon, lat, p_half, p_full, &
293
293
elseif (n == get_tracer_index(MODEL_ATMOS,' methane' )) then ! mj methane tracer
294
294
rst = rm(:,:,:,n) + dt* rdt(:,:,:,n) ! mj
295
295
call methane_source_sink ( flux, sink, p_half, rst, rtnd, kbot ) ! mj
296
- rdt(:,:,:,n) = rdt(:,:,:,n) + rtnd ! mj
296
+ rdt(:,:,:,n) = rdt(:,:,:,n) + rtnd ! mj
297
297
elseif (n == n_pv) then
298
298
rst = rm(:,:,:,n) + dt* rdt(:,:,:,n) ! mj
299
299
tst = tm + dt* tdt ! mj
300
300
call pv_tracer(vom, tst, lat, p_full, dt, rst, rtnd)
301
- rdt(:,:,:,n) = rdt(:,:,:,n) + rtnd ! mj
301
+ rdt(:,:,:,n) = rdt(:,:,:,n) + rtnd ! mj
302
302
elseif (n == get_tracer_index(MODEL_ATMOS, ' APV' )) then ! mj Blocking index as Schwierz2004
303
303
rst = rm(:,:,:,n) + dt* rdt(:,:,:,n) ! mj
304
304
tst = tm + dt* tdt ! mj
@@ -309,7 +309,7 @@ subroutine hs_forcing ( is, ie, js, je, dt, Time, lon, lat, p_half, p_full, &
309
309
pvt = rm(:,:,:,n_pv) + dt* rdt(:,:,:,n_pv) ! mj
310
310
call apv_tracer(pvt,p_full,dt,rst,rtnd)
311
311
endif
312
- rdt(:,:,:,n) = rdt(:,:,:,n) + rtnd ! mj
312
+ rdt(:,:,:,n) = rdt(:,:,:,n) + rtnd ! mj
313
313
else ! mj
314
314
if (query_method(' tracer_sms' , MODEL_ATMOS, n, scheme, params)) then
315
315
if (uppercase(trim (scheme)) == ' NONE' ) cycle
@@ -347,7 +347,7 @@ subroutine hs_forcing_init ( axes, Time, lonb, latb )
347
347
integer , intent (in ) :: axes(4 )
348
348
type (time_type), intent (in ) :: Time
349
349
real , intent (in ), optional , dimension (:,:) :: lonb, latb
350
-
350
+
351
351
352
352
!- ----------------------------------------------------------------------
353
353
integer unit, io, ierr
@@ -405,7 +405,7 @@ subroutine hs_forcing_init ( axes, Time, lonb, latb )
405
405
406
406
! If positive, damping time units are (1/s), value is the inverse of damping time.
407
407
! If negative, damping time units are (days), value is the damping time. It is converted to (1/s)
408
-
408
+
409
409
if (ka < 0 .) then
410
410
tka = - 1 ./ (86400 * ka)
411
411
else
@@ -488,15 +488,15 @@ subroutine hs_forcing_init ( axes, Time, lonb, latb )
488
488
&trim (equilibrium_tau_option) == ' strat_file' ) then
489
489
call interpolator_init (tau_interp, trim (equilibrium_tau_file)// ' .nc' , lonb, latb, data_out_of_bounds= (/ CONSTANT/ ),vert_interp= (/ INTERP_LINEAR_P/ ))
490
490
endif
491
-
491
+
492
492
493
493
module_is_initialized = .true.
494
494
495
495
end subroutine hs_forcing_init
496
496
497
497
! #######################################################################
498
498
499
- subroutine hs_forcing_end
499
+ subroutine hs_forcing_end
500
500
501
501
!- ----------------------------------------------------------------------
502
502
!
@@ -524,7 +524,7 @@ subroutine hs_forcing_end
524
524
call interpolator_end(u_interp)
525
525
call interpolator_end(v_interp)
526
526
endif
527
-
527
+
528
528
module_is_initialized = .false.
529
529
530
530
end subroutine hs_forcing_end
@@ -634,7 +634,7 @@ subroutine newtonian_damping ( Time, lat, ps, p_full, p_half, t, tdt, teq, tau,
634
634
635
635
t_star(:,:) = t_zero - delh* sin_lat_2(:,:) - eps_sc* sin_lat(:,:)
636
636
if ( .not. pv_sat_flag) then
637
- tstr (:,:) = t_strat
637
+ tstr (:,:) = t_strat
638
638
else
639
639
tstr (:,:) = t_tropopause
640
640
endif
@@ -688,7 +688,7 @@ subroutine newtonian_damping ( Time, lat, ps, p_full, p_half, t, tdt, teq, tau,
688
688
endwhere
689
689
else
690
690
call error_mesg (' hs_forcing_nml' , &
691
- ' "' // trim (equilibrium_tau_option)// ' " is not a valid value for equilibrium_tau_option' ,FATAL)
691
+ ' "' // trim (equilibrium_tau_option)// ' " is not a valid value for equilibrium_tau_option' ,FATAL)
692
692
endif
693
693
694
694
@@ -707,7 +707,7 @@ subroutine newtonian_damping ( Time, lat, ps, p_full, p_half, t, tdt, teq, tau,
707
707
p_norm(:,:) = p_full(:,:,k)/ pref
708
708
709
709
do l = 1 ,sat_levs - 1
710
- where (p_norm(:,:) < p_tropopause .and. p_norm(:,:) > sat_p(l+1 ) .and. p_norm(:,:) <= sat_p(l))
710
+ where (p_norm(:,:) < p_tropopause .and. p_norm(:,:) > sat_p(l+1 ) .and. p_norm(:,:) <= sat_p(l))
711
711
t_sat(:,:) = sat_t(l) * (p_norm(:,:)/ sat_p(l))** (- rdgas* sat_g(l)/ grav);
712
712
end where
713
713
end do
@@ -734,7 +734,7 @@ subroutine newtonian_damping ( Time, lat, ps, p_full, p_half, t, tdt, teq, tau,
734
734
phipi_S = phi_S* pif
735
735
where ( lat .ge. phipi_S .and. lat .le. phipi_N )
736
736
P3 = - 1.96e-9 * (lat/ pif)** 4 - 1.15e-5 * (lat/ pif)** 2 + 1
737
- elsewhere ( lat .lt. phipi_S )
737
+ elsewhere ( lat .lt. phipi_S )
738
738
P3 = - 1.96e-9 * (phi_S)** 4 - 1.15e-5 * (phi_S)** 2 + 1
739
739
elsewhere ( lat .gt. phipi_N )
740
740
P3 = - 1.96e-9 * (phi_N)** 4 - 1.15e-5 * (phi_N)** 2 + 1
@@ -756,7 +756,7 @@ subroutine newtonian_damping ( Time, lat, ps, p_full, p_half, t, tdt, teq, tau,
756
756
P4 = (P3 - 1 .)* p_norm + 1 .
757
757
elsewhere ( p_full(:,:,k) <= p_1 )
758
758
P4 = P3
759
- endwhere
759
+ endwhere
760
760
! Add polar amplitudes
761
761
p_norm(:,:) = log (p_full(:,:,k)/ p_t)/ (log (p_1/ 1000.e2 ) - log (p_t/ 1000.e2 ))
762
762
p_n = log (p_1 / p_t)/ (log (p_1/ 1000.e2 ) - log (p_t/ 1000.e2 ))
@@ -811,7 +811,7 @@ subroutine newtonian_damping ( Time, lat, ps, p_full, p_half, t, tdt, teq, tau,
811
811
Pp = ( logphs - log (p_full) )/ ( logphs - logpbd )
812
812
teq = Pp* teq_strat + (1 . - Pp)* teq
813
813
elsewhere ( p_full .lt. p_bd )
814
- teq = teq_strat
814
+ teq = teq_strat
815
815
end where
816
816
end if
817
817
! ! same for damping rate
@@ -844,9 +844,9 @@ subroutine newtonian_damping ( Time, lat, ps, p_full, p_half, t, tdt, teq, tau,
844
844
do k= 1 ,size (t,3 )
845
845
P4 = min (1 .,( Pp(:,:,k) - P2 )/ P3)
846
846
tau_strat(:,:,k) = ( tau_strat(:,:,k) - tau_m )* P4 + tau_m
847
+ ! scale profile
848
+ tau_strat(:,:,k) = (1 .- tau_fact)* tau_t + tau_fact* tau_strat(:,:,k)
847
849
enddo
848
- ! scale profile
849
- tau_strat(:,:,k) = (1 .- tau_fact)* tau_t + tau_fact* tau_strat(:,:,k)
850
850
! convert days to seconds
851
851
tau_strat = tau_strat* 86400
852
852
! convert to damping rate
@@ -863,7 +863,7 @@ subroutine newtonian_damping ( Time, lat, ps, p_full, p_half, t, tdt, teq, tau,
863
863
Pp = ( logphs - log (p_full) )/ ( logphs - logpbd )
864
864
tdamp = Pp* tau_strat + (1 . - Pp)* tdamp
865
865
elsewhere ( p_full .lt. p_bd )
866
- tdamp = tau_strat
866
+ tdamp = tau_strat
867
867
end where
868
868
endif
869
869
@@ -1006,7 +1006,7 @@ subroutine sphum_source_sink ( flux, damp, p_full, r, rdt, s_geo, t, dt, kbot )
1006
1006
if (rdamp > 0 .) rdamp = 1 ./ rdamp
1007
1007
1008
1008
!- ----------- surface source and global sink ---------------------------
1009
-
1009
+
1010
1010
source(:,:,:)= 0.0
1011
1011
sink(:,:,:)= 0.0 ! mj
1012
1012
sea_surf= 0 ! mj
@@ -1029,7 +1029,7 @@ subroutine sphum_source_sink ( flux, damp, p_full, r, rdt, s_geo, t, dt, kbot )
1029
1029
kb = size (r,3 )
1030
1030
qsat = RDGAS* ES0* exp (- HLV* (1 ./ t - 1 ./ TFREEZE)/ RVGAS)/ RVGAS ! mj
1031
1031
qsat = qsat/ p_full ! mj
1032
- source(:,:,kb) = max (0 .,- vkf* (r(:,:,kb)- qsat(:,:,kb))) ! mj
1032
+ source(:,:,kb) = max (0 .,- vkf* (r(:,:,kb)- qsat(:,:,kb))) ! mj
1033
1033
source(:,:,kb) = source(:,:,kb)* sea_surf(:,:) ! mj mountains
1034
1034
endif
1035
1035
@@ -1039,9 +1039,9 @@ subroutine sphum_source_sink ( flux, damp, p_full, r, rdt, s_geo, t, dt, kbot )
1039
1039
! sink = 1. + qsat*HLV*HLV/(RVGAS*CP_AIR*t*t) !mj as in Frierson 2006 JAS
1040
1040
! sink = (r - qsat)/sink/dt !mj continued
1041
1041
end where
1042
-
1042
+
1043
1043
! sink = sink + rdamp*r !mj add global sink
1044
-
1044
+
1045
1045
! sink = 0.
1046
1046
! sink = r/dt
1047
1047
! source = 0.
@@ -1066,13 +1066,13 @@ subroutine age_source_sink ( flux, damp, p_half, r, rdt, kbot )
1066
1066
integer :: i, j, kb
1067
1067
real :: rdamp
1068
1068
!- ----------------------------------------------------------------------
1069
-
1069
+
1070
1070
rdamp = damp
1071
1071
if (rdamp < 0 .) rdamp = - 86400 .* rdamp ! convert days to seconds
1072
1072
if (rdamp > 0 .) rdamp = 1 ./ rdamp
1073
1073
1074
1074
!- ----------- simple surface source and no sink --------------------
1075
-
1075
+
1076
1076
source= 0.0
1077
1077
sink = 0.0
1078
1078
@@ -1092,7 +1092,7 @@ subroutine age_source_sink ( flux, damp, p_half, r, rdt, kbot )
1092
1092
1093
1093
sink = rdamp* r
1094
1094
1095
- rdt = source - sink
1095
+ rdt = source - sink
1096
1096
1097
1097
!- ----------------------------------------------------------------------
1098
1098
@@ -1118,7 +1118,7 @@ subroutine methane_source_sink ( flux, damp, p_half, r, rdt, kbot )
1118
1118
if (rdamp > 0 .) rdamp = 1 ./ rdamp
1119
1119
1120
1120
!- ----------- surface source and global sink ---------------------------
1121
-
1121
+
1122
1122
source(:,:,:)= 0.0
1123
1123
sink(:,:,:)= 0.0 ! mj
1124
1124
@@ -1134,14 +1134,14 @@ subroutine methane_source_sink ( flux, damp, p_half, r, rdt, kbot )
1134
1134
kb = size (r,3 )
1135
1135
source(:,:,kb) = - vkf* (r(:,:,kb)- flux) ! mj tracer value fixed to trflux at bottom
1136
1136
endif
1137
-
1137
+
1138
1138
1139
1139
sink = rdamp* r
1140
-
1140
+
1141
1141
1142
1142
rdt = source - sink
1143
1143
1144
-
1144
+
1145
1145
1146
1146
!- ----------------------------------------------------------------------
1147
1147
@@ -1160,8 +1160,8 @@ subroutine pv_tracer ( vorn, temp, lat, p_full, dt, r, rdt )
1160
1160
! real,dimension(size(rdt,1),size(rdt,2)) :: wa,dTheta
1161
1161
real :: wa,dTheta
1162
1162
!- ----------------------------------------------------------------------
1163
-
1164
-
1163
+
1164
+
1165
1165
do k= 2 ,size (rdt,3 ) ! actual value
1166
1166
do j= 1 ,size (rdt,2 )
1167
1167
do i= 1 ,size (rdt,1 )
@@ -1173,7 +1173,7 @@ subroutine pv_tracer ( vorn, temp, lat, p_full, dt, r, rdt )
1173
1173
enddo
1174
1174
rdt(:,:,1 )= rdt(:,:,2 )
1175
1175
! !$ rdt = vorn
1176
-
1176
+
1177
1177
if (dt.gt. 0.0 )then ! normal pv tracer
1178
1178
rdt = (rdt- r)/ dt
1179
1179
endif
@@ -1197,8 +1197,8 @@ subroutine apv_tracer ( pv, p_half, dt, r, rdt )
1197
1197
p_high = 50000 .
1198
1198
del_p = 0 .
1199
1199
apv = 0 .
1200
-
1201
- do k= 2 ,size (rdt,3 )
1200
+
1201
+ do k= 2 ,size (rdt,3 )
1202
1202
do j= 1 ,size (rdt,2 )
1203
1203
do i= 1 ,size (rdt,1 )
1204
1204
if (p_half(i,j,k) >= p_low .and. p_half(i,j,k+1 ) <= p_high)then
@@ -1215,7 +1215,7 @@ subroutine apv_tracer ( pv, p_half, dt, r, rdt )
1215
1215
enddo
1216
1216
rdt(:,:,1 )= rdt(:,:,2 )
1217
1217
! !$ rdt = vorn
1218
-
1218
+
1219
1219
rdt = (rdt- r)/ dt
1220
1220
1221
1221
!- ----------------------------------------------------------------------
@@ -1338,8 +1338,8 @@ subroutine local_heating ( Time, is, js, lon, lat, ps, p_full, p_half, surf_geop
1338
1338
if (z_full(i,j,k)<= 12e3 ) then
1339
1339
z_factor = sin ((pi* z_full(i,j,k))/ 12e3 )
1340
1340
tdt(i,j,k) = srfamp* lat_factor(i,j)* z_factor
1341
- else
1342
- tdt(i,j,k) = 0
1341
+ else
1342
+ tdt(i,j,k) = 0
1343
1343
endif
1344
1344
enddo
1345
1345
enddo
@@ -1456,4 +1456,3 @@ end subroutine get_tau
1456
1456
! #######################################################################
1457
1457
1458
1458
end module hs_forcing_mod
1459
-
0 commit comments