@@ -124,12 +124,23 @@ module generic_CFC
124
124
125
125
type generic_CFC_type
126
126
integer :: &
127
- id_fgcfc11 = - 1 , &
128
- id_fgcfc12 = - 1
127
+ id_fgcfc11 = - 1 , &
128
+ id_fgcfc12 = - 1 , &
129
+ id_wc_vert_int_cfc11 = - 1 , &
130
+ id_wc_vert_int_cfc12 = - 1
131
+
132
+ real , dimension (:,:), ALLOCATABLE :: &
133
+ wc_vert_int_cfc11, &
134
+ wc_vert_int_cfc12
135
+
129
136
real , dimension (:,:), pointer :: &
130
137
stf_gas_cfc11, &
131
138
stf_gas_cfc12
132
139
140
+ real , dimension (:,:,:,:), pointer :: &
141
+ p_cfc11, &
142
+ p_cfc12
143
+
133
144
end type generic_CFC_type
134
145
135
146
type (generic_CFC_type) :: cfc
@@ -144,8 +155,6 @@ subroutine generic_CFC_register(tracer_list)
144
155
! Specify all prognostic and diagnostic tracers of this modules.
145
156
call user_add_tracers(tracer_list)
146
157
147
-
148
-
149
158
end subroutine generic_CFC_register
150
159
151
160
! <SUBROUTINE NAME="generic_CFC_init">
@@ -175,7 +184,7 @@ subroutine generic_CFC_init(tracer_list)
175
184
call user_add_params
176
185
177
186
! Allocate and initiate all the private work arrays used by this module.
178
- ! call user_allocate_arrays !None for CFC module currently
187
+ call user_allocate_arrays
179
188
180
189
end subroutine generic_CFC_init
181
190
@@ -214,14 +223,33 @@ subroutine generic_CFC_register_diag(diag_list)
214
223
init_time, vardesc_temp% longname,vardesc_temp% units, missing_value = missing_value1, &
215
224
standard_name= " surface_downward_mole_flux_of_cfc12" )
216
225
226
+ vardesc_temp = vardesc(" wc_vert_int_cfc11" ," Total CFC11 vertical integral" ,' h' ,' 1' ,' s' ,' mol m-2' ,' f' )
227
+ cfc% id_wc_vert_int_cfc11 = register_diag_field(package_name, vardesc_temp% name, axes(1 :2 ),&
228
+ init_time, vardesc_temp% longname,vardesc_temp% units, missing_value = missing_value1)
229
+
230
+ vardesc_temp = vardesc(" wc_vert_int_cfc12" ," Total CFC12 vertical integral" ,' h' ,' 1' ,' s' ,' mol m-2' ,' f' )
231
+ cfc% id_wc_vert_int_cfc12 = register_diag_field(package_name, vardesc_temp% name, axes(1 :2 ),&
232
+ init_time, vardesc_temp% longname,vardesc_temp% units, missing_value = missing_value1)
233
+
217
234
end subroutine generic_CFC_register_diag
218
235
219
236
220
237
subroutine user_allocate_arrays
221
- ! Allocate all the private arrays.
222
- ! None for CFC module currently
238
+ integer :: isc,iec,jsc,jec,isd,ied,jsd,jed,nk,ntau,n
239
+ call g_tracer_get_common(isc,iec,jsc,jec,isd,ied,jsd,jed,nk,ntau)
240
+
241
+ allocate (cfc% wc_vert_int_cfc11(isd:ied, jsd:jed)) ; cfc% wc_vert_int_cfc11= 0.0
242
+ allocate (cfc% wc_vert_int_cfc12(isd:ied, jsd:jed)) ; cfc% wc_vert_int_cfc12= 0.0
243
+
223
244
end subroutine user_allocate_arrays
224
245
246
+ subroutine user_deallocate_arrays
247
+
248
+ deallocate (cfc% wc_vert_int_cfc11)
249
+ deallocate (cfc% wc_vert_int_cfc12)
250
+
251
+ end subroutine user_deallocate_arrays
252
+
225
253
!
226
254
! This is an internal sub, not a public interface.
227
255
! Add all the parameters to be used in this module.
@@ -330,8 +358,6 @@ subroutine user_add_params
330
358
! Block Ends: g_tracer_add_param
331
359
! ===========
332
360
333
-
334
-
335
361
end subroutine user_add_params
336
362
337
363
!
@@ -407,7 +433,6 @@ subroutine user_add_tracers(tracer_list)
407
433
diag_field_units = ' mol m-3' , &
408
434
diag_field_scaling_factor = 1035.0 ) ! rho = 1035.0 kg/m3, converts mol/kg to mol/m3
409
435
410
-
411
436
end subroutine user_add_tracers
412
437
413
438
! <SUBROUTINE NAME="generic_CFC_update_from_coupler">
@@ -456,6 +481,7 @@ subroutine generic_CFC_update_from_source(tracer_list,rho_dzt,dzt,hblt_depth,&
456
481
457
482
character (len= fm_string_len), parameter :: sub_name = ' generic_SF6_update_from_source'
458
483
integer :: isc,iec, jsc,jec,isd,ied,jsd,jed,nk,ntau
484
+ integer :: i, j, k
459
485
real , dimension (:,:,:) ,pointer :: grid_tmask
460
486
integer , dimension (:,:),pointer :: mask_coast, grid_kmt
461
487
@@ -467,6 +493,20 @@ subroutine generic_CFC_update_from_source(tracer_list,rho_dzt,dzt,hblt_depth,&
467
493
call g_tracer_get_pointer(tracer_list,' cfc11' ,' stf_gas' ,cfc% stf_gas_cfc11)
468
494
call g_tracer_get_pointer(tracer_list,' cfc12' ,' stf_gas' ,cfc% stf_gas_cfc12)
469
495
496
+ call g_tracer_get_pointer(tracer_list,' cfc11' ,' field' , cfc% p_cfc11)
497
+ call g_tracer_get_pointer(tracer_list,' cfc12' ,' field' , cfc% p_cfc12)
498
+
499
+ !- - calculate water column vertical integrals
500
+ do j = jsc, jec ; do i = isc, iec ! {
501
+ cfc% wc_vert_int_cfc11(i,j) = 0.0
502
+ cfc% wc_vert_int_cfc12(i,j) = 0.0
503
+ enddo ; enddo ! } i,j
504
+
505
+ do j = jsc, jec ; do i = isc, iec ; do k = 1 , nk ! {
506
+ cfc% wc_vert_int_cfc11(i,j) = cfc% wc_vert_int_cfc11(i,j) + (cfc% p_cfc11(i,j,k,tau) * rho_dzt(i,j,k))
507
+ cfc% wc_vert_int_cfc12(i,j) = cfc% wc_vert_int_cfc12(i,j) + (cfc% p_cfc12(i,j,k,tau) * rho_dzt(i,j,k))
508
+ enddo ; enddo ; enddo ! } i,j,k
509
+
470
510
if (cfc% id_fgcfc11 .gt. 0 ) &
471
511
used = g_send_data(cfc% id_fgcfc11, cfc% stf_gas_cfc11, &
472
512
model_time, rmask = grid_tmask(:,:,1 ),&
@@ -477,6 +517,16 @@ subroutine generic_CFC_update_from_source(tracer_list,rho_dzt,dzt,hblt_depth,&
477
517
model_time, rmask = grid_tmask(:,:,1 ),&
478
518
is_in= isc, js_in= jsc, ie_in= iec, je_in= jec)
479
519
520
+ if (cfc% id_wc_vert_int_cfc11 .gt. 0 ) &
521
+ used = g_send_data(cfc% id_wc_vert_int_cfc11, cfc% wc_vert_int_cfc11, &
522
+ model_time, rmask = grid_tmask(:,:,1 ),&
523
+ is_in= isc, js_in= jsc, ie_in= iec, je_in= jec)
524
+
525
+ if (cfc% id_wc_vert_int_cfc12 .gt. 0 ) &
526
+ used = g_send_data(cfc% id_wc_vert_int_cfc12, cfc% wc_vert_int_cfc12, &
527
+ model_time, rmask = grid_tmask(:,:,1 ),&
528
+ is_in= isc, js_in= jsc, ie_in= iec, je_in= jec)
529
+
480
530
return
481
531
end subroutine generic_CFC_update_from_source
482
532
@@ -655,6 +705,8 @@ end subroutine generic_CFC_set_boundary_values
655
705
subroutine generic_CFC_end
656
706
character (len= fm_string_len), parameter :: sub_name = ' generic_CFC_end'
657
707
708
+ call user_deallocate_arrays
709
+
658
710
end subroutine generic_CFC_end
659
711
660
712
0 commit comments