-
Notifications
You must be signed in to change notification settings - Fork 0
/
GMIchem_GridCompMod.F90
3059 lines (2378 loc) · 115 KB
/
GMIchem_GridCompMod.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "MAPL_Generic.h"
!-------------------------------------------------------------------------
! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 !
!-------------------------------------------------------------------------
!BOP
!
! !MODULE: GMIchem_GridCompMod - The GMI COMBO Model Grid Component
!
! !INTERFACE:
!
MODULE GMIchem_GridCompMod
!
! !USES:
!
USE ESMF
USE MAPL
USE Runtime_RegistryMod
USE Species_BundleMod
USE Chem_Mod ! Chemistry Base Class
USE GMI_GridCompMod ! ESMF parent component
USE Chem_UtilMod, ONLY : Chem_UtilNegFiller ! Eliminates negative vmr
USE Chem_GroupMod ! For Family Transport
USE OVP, ONLY: OVP_init, OVP_end_of_timestep_hms, OVP_mask, OVP_apply_mask
USE GmiESMFrcFileReading_mod, ONLY : rcEsmfReadTable
USE GmiStringManipulation_mod, ONLY : constructListNames
IMPLICIT NONE
PRIVATE
TYPE(Chem_Mie), DIMENSION(2), SAVE :: gocartMieTable
INTEGER, SAVE, ALLOCATABLE :: MASK_10AM(:,:)
INTEGER, SAVE, ALLOCATABLE :: MASK_2PM(:,:)
INTEGER, SAVE :: OVP_FIRST_HMS
INTEGER, SAVE :: OVP_RUN_DT
INTEGER, SAVE :: OVP_GC_DT
INTEGER, SAVE :: OVP_MASK_DT
#include "setkin_par.h"
#include "GmiParameters.h"
!
! !PUBLIC MEMBER FUNCTIONS:
!
PUBLIC SetServices
!
! !PRIVATE MEMBER FUNCTIONS:
!
PRIVATE :: Initialize_ ! Init method
PRIVATE :: Run_ ! Run method
PRIVATE :: Finalize_ ! Finalize method
PRIVATE :: Run1 ! Run wrapper phase 1
PRIVATE :: Run2 ! Run wrapper phase 2
PRIVATE :: extract_ ! Get values from ESMF
PRIVATE :: aerosol_optics ! Get params for aero optics
PRIVATE :: secure_species_ptr ! Find species in a Species Bundle
!
! !DESCRIPTION:
!
! {\tt GMIchem\_GridComp} is a ESMF gridded component for the Global Modeling
! Initiative combined troposphere/stratospheric chemistry package.
! !REVISION HISTORY:
! 31Jul2006 da Silva Created the GMI stub.
! 11Dec2007 Nielsen Real code for Eros-beta7p17.
! 25Nov2011 Nielsen Trying cubed sphere.
! 10Sep2013 Nielsen Added run alarm, but allow for updating age-of-air and for
! returning zero tendencies, etc., when alarm is not ringing.
!
!EOP
!-------------------------------------------------------------------------
TYPE GMIchem_State
PRIVATE
TYPE(Chem_Registry), POINTER :: chemReg => null()
TYPE(Runtime_Registry), POINTER :: ggReg => null() ! Names of GMI Species - transported
TYPE(Runtime_Registry), POINTER :: xxReg => null() ! Names of GMI Species - not transported
TYPE(GMI_GridComp), POINTER :: gcGMI => null()
TYPE(Chem_Bundle), POINTER :: w_c => null()
TYPE(Species_Bundle), POINTER :: bgg => null() ! Bundle of GMI Species - transported
TYPE(Species_Bundle), POINTER :: bxx => null() ! Bundle of GMI Species - not transported
END TYPE GMIchem_State
TYPE GMIchem_WRAP
TYPE (GMIchem_State), pointer :: PTR => null()
END TYPE GMIchem_WRAP
! Number of run phases. Can be set in the resource file (default is 2).
INTEGER :: PHASE_COUNT
CONTAINS
!-------------------------------------------------------------------------
! NASA/GSFC, Global Modeling and Assimilation Office, Code 910.1 !
!-------------------------------------------------------------------------
!BOP
!
! !IROUTINE: SetServices --- Sets IRF services for GMIchem Grid Component
!
! !INTERFACE:
SUBROUTINE SetServices ( GC, RC )
! !ARGUMENTS:
type(ESMF_GridComp), intent(INOUT) :: GC ! gridded component
integer, optional :: RC ! return code
! !DESCRIPTION: Sets Initialize, Run and Finalize services.
!
! !REVISION HISTORY:
!
! 31Jul2006 da Silva First crack.
!
!EOP
!-------------------------------------------------------------------------
! ErrLog Variables
! ----------------
character(len=ESMF_MAXSTR) :: IAm
integer :: STATUS
character(len=ESMF_MAXSTR) :: COMP_NAME
! Local derived type aliases
! --------------------------
type (ESMF_Config) :: CF
type (GMIchem_State), pointer :: state ! internal, that is
type (GMIchem_wrap) :: wrap
integer :: m, n, i_XX, j_XX
CHARACTER(LEN=ESMF_MAXSTR) :: FRIENDLIES
CHARACTER(LEN=ESMF_MAXSTR) :: providerName
CHARACTER(LEN=ESMF_MAXSTR) :: aeroProviderName
LOGICAL :: searchForImports
INTEGER, PARAMETER :: numAeros = 5
CHARACTER(LEN=2) :: aeroID(numAeros) = (/ "BC", "DU", "OC", "SS", "SU" /)
CHARACTER(LEN=2) :: leadChars
CHARACTER(LEN=ESMF_MAXSTR) :: name
LOGICAL :: do_ShipEmission
INTEGER :: fastj_opt
TYPE(ESMF_Config) :: gmiConfig
! HEMCO isoprene related -sas
CHARACTER(LEN=255) :: gmi_rcfilen = 'GMI_GridComp.rc'
TYPE (ESMF_Config) :: gmi_config
LOGICAL :: doMEGANviaHEMCO
CHARACTER (LEN=MAX_STRING_LENGTH) :: extdataBcSpeciesNames
CHARACTER (LEN=MAX_LENGTH_SPECIES_NAME), pointer :: tempListNames(:)
INTEGER :: bc_count, ic
! Get my name and set-up traceback handle
! ---------------------------------------
call ESMF_GridCompGet( GC, NAME=COMP_NAME, CONFIG=CF, RC=STATUS )
VERIFY_(STATUS)
Iam = TRIM(COMP_NAME)//"::SetServices"
! Wrap internal state for storing in GC; rename legacyState
! -------------------------------------
allocate ( state, stat=STATUS )
VERIFY_(STATUS)
wrap%ptr => state
! Start by loading the Chem Registry
! ----------------------------------
allocate ( state%chemReg, __STAT__ )
state%chemReg = Chem_RegistryCreate ( STATUS )
VERIFY_(STATUS)
allocate ( state%ggReg, __STAT__ )
state%ggReg = Runtime_RegistryCreate ( 'GMI_Mech_Registry.rc', 'GMI_table::', STATUS )
VERIFY_(STATUS)
allocate ( state%xxReg, __STAT__ )
state%xxReg = Runtime_RegistryCreate ( 'GMI_Mech_Registry.rc', 'XX_table::', STATUS )
VERIFY_(STATUS)
! ------------------------
! ESMF Functional Services
! ------------------------
IF(MAPL_AM_I_ROOT()) THEN
PRINT *, TRIM(Iam)//': GMI'
CALL Runtime_RegistryPrint ( state%ggReg, 'GMI' )
PRINT *, TRIM(Iam)//': XX'
CALL Runtime_RegistryPrint ( state%xxReg, 'XX' )
PRINT *, TRIM(Iam)//': OTHERS'
CALL Chem_RegistryPrint ( state%chemReg )
END IF
! Set the Initialize, Run, Finalize entry points
! ----------------------------------------------
CALL MAPL_GridCompSetEntryPoint(GC, ESMF_METHOD_INITIALIZE, Initialize_, __RC__ )
CALL MAPL_GridCompSetEntryPoint(GC, ESMF_METHOD_RUN, Run1, __RC__ )
CALL MAPL_GridCompSetEntryPoint(GC, ESMF_METHOD_RUN, Run2, __RC__ )
CALL MAPL_GridCompSetEntryPoint(GC, ESMF_METHOD_FINALIZE, Finalize_, __RC__ )
! Store internal state in GC
! --------------------------
CALL ESMF_UserCompSetInternalState(GC, 'GMIchem_state', wrap, STATUS)
VERIFY_(STATUS)
! ========================= IMPORT STATE =========================
CALL ESMF_ConfigGetAttribute(CF, aeroProviderName, DEFAULT='none', LABEL="AERO_PROVIDER:", __RC__ )
If (ESMF_UtilStringLowerCase(trim(aeroProviderName)).eq.'none') aeroProviderName = 'none'
SELECT CASE (TRIM(aeroProviderName))
CASE ("GOCART")
! GOCART aerosols and dust. With the exception of
! SO4, select upon dust/aerosol two-letter identifier
! ---------------------------------------------------
DO m=1,numAeros-1
searchForImports = .FALSE.
SELECT CASE (aeroID(m))
CASE("BC")
searchForImports = state%chemReg%doing_BC
CASE("DU")
searchForImports = state%chemReg%doing_DU
CASE("OC")
searchForImports = state%chemReg%doing_OC
CASE("SS")
searchForImports = state%chemReg%doing_SS
CASE DEFAULT
searchForImports = .FALSE.
END SELECT
Doing_Search: IF(searchForImports) THEN
IF(MAPL_AM_I_ROOT() .AND. m == 1) PRINT *,"Adding the following from GOCART to GMICHEM import state:"
DO n = state%chemReg%i_GOCART, state%chemReg%j_GOCART
name = TRIM(state%chemReg%vname(n))
leadChars = ESMF_UtilStringUpperCase(name(1:2))
Match: IF(leadChars == aeroID(m)) THEN
CALL MAPL_AddImportSpec(GC, &
SHORT_NAME = "GOCART::"//TRIM(state%chemReg%vname(n)), &
LONG_NAME = state%chemReg%vtitle(n), &
UNITS = state%chemReg%vunits(n), &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, RC=STATUS )
VERIFY_(STATUS)
IF(MAPL_AM_I_ROOT()) PRINT *," ",TRIM(state%chemReg%vname(n))
END IF Match
END DO
END IF Doing_Search
END DO
! This is the special case for SO4, which
! does not have "SU" as its leading two characters
! ------------------------------------------------
IF(state%chemReg%doing_SU) THEN
Doing_SO4: DO n = state%chemReg%i_SU, state%chemReg%j_SU
IF( (TRIM(state%chemReg%vname(n)) == "SO4" ) .OR. &
(TRIM(state%chemReg%vname(n)) == "SO4v") ) THEN
CALL MAPL_AddImportSpec(GC, &
SHORT_NAME = "GOCART::"//TRIM(state%chemReg%vname(n)), &
LONG_NAME = state%chemReg%vtitle(n), &
UNITS = state%chemReg%vunits(n), &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, RC=STATUS )
VERIFY_(STATUS)
IF(MAPL_AM_I_ROOT()) PRINT *," ",TRIM(state%chemReg%vname(n))
END IF
END DO Doing_SO4
END IF
CASE("GOCART.data")
CALL MAPL_AddImportSpec(GC, &
SHORT_NAME = 'AERO', &
LONG_NAME = 'aerosol_mass_mixing_ratios', &
UNITS = 'kg kg-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_StateItem, &
RESTART = MAPL_RestartSkip, &
RC=STATUS )
VERIFY_(STATUS)
CASE("GOCART2G")
! GOCART2G aerosols and dust
! --------------------------
call MAPL_AddImportSpec(GC, &
short_name = 'AERO', &
long_name = 'aerosol_mass_mixing_ratios_ng', &
units = 'kg kg-1', &
dims = MAPL_DimsHorzVert, &
vlocation = MAPL_VLocationCenter, &
RESTART = MAPL_RestartSkip, &
datatype = MAPL_StateItem, __RC__)
CASE("GMICHEM")
STATUS = 0
CASE("CARMA")
STATUS = 0
CASE("none")
STATUS = 0
CASE DEFAULT
PRINT *, TRIM(Iam)//": Invalid AERO_PROVIDER when running GMIChem."
STATUS = 1
VERIFY_(STATUS)
END SELECT
! Import NO from Ships, only if using the parameterization
! Import RI and RL, only if using Cloud-J
gmiConfig = ESMF_ConfigCreate(__RC__)
call ESMF_ConfigLoadFile(gmiConfig, 'GMI_GridComp.rc', __RC__)
! This duplicates the call in the Forced BC code; really should only be done once!
call rcEsmfReadTable(gmiConfig, extdataBcSpeciesNames, "extdataBcSpeciesNames::", __RC__)
! Set the initial value of the list
allocate(tempListNames(NSP))
tempListNames(:) = ''
call constructListNames(tempListNames, extdataBcSpeciesNames)
bc_count = COUNT (tempListNames(:) /= '')
do ic = 1, bc_count
call MAPL_AddImportSpec(GC, &
SHORT_NAME = TRIM(tempListNames(ic))//'_BC', &
LONG_NAME = 'Surface BC for '//TRIM(tempListNames(ic)), &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, __RC__)
end do
deallocate(tempListNames)
! This duplicates the call in the Emissions code; really should only be done once!
! call rcEsmfReadLogical(gmiConfig, do_ShipEmission, "do_ShipEmission:", default=.false., __RC__)
CALL ESMF_ConfigGetAttribute(gmiConfig, value= do_ShipEmission, Default=.false., &
Label="do_ShipEmission:", __RC__)
IF ( do_ShipEmission ) THEN
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'SHIP_NO', &
LONG_NAME = 'NO from Ships', &
UNITS = 'kg NO m^(-2) s^(-1)', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, __RC__)
END IF
CALL ESMF_ConfigGetAttribute(gmiConfig, value= fastj_opt, Default=4, &
Label="fastj_opt:", __RC__)
! We need RI and RL for Cloud-J
! The fields may not be available in CTM, so we import them conditionally
IF ( fastj_opt == 5 ) THEN
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'RI', &
LONG_NAME = 'ice_phase_cloud_particle_effective_radius', &
UNITS = 'm', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, __RC__)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'RL', &
LONG_NAME = 'liquid_cloud_particle_effective_radius', &
UNITS = 'm', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, __RC__)
END IF
call ESMF_ConfigDestroy(gmiConfig, __RC__)
! Future option - import OCS from ACHEM - if (state%chemReg%doing_OCS) then import ACHEM::OCS
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'OCS_CLIMO', &
LONG_NAME = 'Carbonyl Sulfide (OCS gas)', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, __RC__)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'CNV_FRC', &
LONG_NAME = 'convective_fraction', &
UNITS = '', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, __RC__)
! add MEGAN emission imports -sas
! note: might change this later to use GMICHEM_ImportSpec___.h
gmi_config = ESMF_ConfigCreate(__RC__ )
call ESMF_ConfigLoadFile(gmi_config, TRIM(gmi_rcfilen), __RC__ )
call ESMF_ConfigGetAttribute(gmi_config, value= doMEGANviaHEMCO, &
label="doMEGANviaHEMCO:", default=.false., __RC__ )
IF ( doMEGANviaHEMCO ) THEN
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'GMI_ISOPRENE', &
LONG_NAME = 'isoprene emissions' , &
UNITS = 'kgC/m2/s', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RESTART = MAPL_RestartSkip, &
RC = STATUS)
VERIFY_(STATUS)
END IF
! Can the Registry specify PRECISION?
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'LIGHT_NO_PROD', &
LONG_NAME = 'lightning_NO_prod_rate', &
UNITS = 'm-3 s-1', &
DIMS = MAPL_DimsHorzVert, &
PRECISION = ESMF_KIND_R4, &
VLOCATION = MAPL_VLocationCenter, __RC__ )
! Can the Registry specify UNGRIDDED_DIMS?
! Note: 72 = (NVEGTYPE-2)
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'VEG_FRAC', &
LONG_NAME = 'Olson_land_type_fraction_mils', &
UNITS = 'mil', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
UNGRIDDED_DIMS = [72], &
RESTART = MAPL_RestartSkip, __RC__ )
call MAPL_AddImportSpec(GC, &
SHORT_NAME = 'LAI_FRAC', &
LONG_NAME = 'GMI_leaf_area_index', &
UNITS = '1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
UNGRIDDED_DIMS = [72], &
RESTART = MAPL_RestartSkip, __RC__ )
#include "GMICHEM_ImportSpec___.h"
! ======================== INTERNAL STATE =========================
! Is GMICHEM providing ozone (mole fraction) to the ANALYSIS bundle?
! ------------------------------------------------------------------
CALL ESMF_ConfigGetAttribute(CF, providerName, Default="PCHEM", &
Label="ANALYSIS_OX_PROVIDER:", RC=STATUS )
VERIFY_(STATUS)
! Species to be transported:
! --------------------------
DO n = 1, state%ggReg%nq
IF(TRIM(state%ggReg%vname(n)) == "OX" .AND. TRIM(providerName) == "GMICHEM") THEN
FRIENDLIES="ANALYSIS:DYNAMICS:TURBULENCE:MOIST"
ELSE
FRIENDLIES="DYNAMICS:TURBULENCE:MOIST"
END IF
FRIENDLIES = FRIENDLIES//':'//TRIM(COMP_NAME)
CALL MAPL_AddInternalSpec(GC, &
SHORT_NAME = TRIM(state%ggReg%vname(n)), &
LONG_NAME = TRIM(state%ggReg%vtitle(n)), &
UNITS = TRIM(state%ggReg%vunits(n)), &
FRIENDLYTO = TRIM(FRIENDLIES), &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, RC=STATUS )
VERIFY_(STATUS)
END DO
! Non-transported species
! -----------------------
DO n = 1, state%xxReg%nq
CALL MAPL_AddInternalSpec(GC, &
SHORT_NAME = TRIM(state%xxReg%vname(n)), &
LONG_NAME = TRIM(state%xxReg%vtitle(n)), &
UNITS = TRIM(state%xxReg%vunits(n)), &
FRIENDLYTO = TRIM(COMP_NAME), &
ADD2EXPORT = .TRUE., &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, RC=STATUS )
VERIFY_(STATUS)
END DO
! Families to be transported:
! --------------------------
FRIENDLIES="DYNAMICS"
CALL MAPL_AddInternalSpec(GC, &
SHORT_NAME = "Bry", &
LONG_NAME = "Bry for family transport", &
UNITS = "mol mol-1", &
FRIENDLYTO = TRIM(FRIENDLIES), &
RESTART = MAPL_RestartSkip, &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, RC=STATUS )
VERIFY_(STATUS)
CALL MAPL_AddInternalSpec(GC, &
SHORT_NAME = "Cly", &
LONG_NAME = "Cly for family transport", &
UNITS = "mol mol-1", &
FRIENDLYTO = TRIM(FRIENDLIES), &
RESTART = MAPL_RestartSkip, &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, RC=STATUS )
VERIFY_(STATUS)
! ========================== EXPORT STATE =========================
IF(TRIM(aeroProviderName) == "GMICHEM" .or. TRIM(aeroProviderName) == "CARMA") THEN
! This state is needed by radiation, and contains aerosols and aerosol optics
! ---------------------------------------------------------------------------
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'AERO', &
LONG_NAME = 'aerosol_mass_mixing_ratios', &
UNITS = 'kg kg-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_StateItem, &
RC=STATUS )
VERIFY_(STATUS)
! This state is needed by MOIST - It should contain aerosol info.
! For GMI aerosols, the functionality is turned off.
! ---------------------------------------------------------------
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'AERO_ACI', &
LONG_NAME = 'aerosol_cloud_interaction', &
UNITS = 'kg kg-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_StateItem, __RC__)
! This bundle is reserved for SURFACE to update snow albedo due to
! aerosol settling and deposition. But since GMI's aerosols are prescribed,
! they are considered "data-driven," and the bundle is not filled by GMICHEM.
! ---------------------------------------------------------------------------
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'AERO_DP', &
LONG_NAME = 'aerosol_deposition', &
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)
END IF
! SAD related variables
! ---------------------
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'HNO3CONDsad' , &
LONG_NAME = 'condensed_phase_hno3', &
UNITS = 'mixing_ratio', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
PRECISION = ESMF_KIND_R8, &
RC=STATUS )
VERIFY_(STATUS)
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'HNO3GASsad' , &
LONG_NAME = 'gas_phase-hno3', &
UNITS = 'mixing_ratio', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
PRECISION = ESMF_KIND_R8, &
RC=STATUS )
VERIFY_(STATUS)
! Ship Emissions
! --------------
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'jNO2val', &
LONG_NAME = 'photolysis_rate_constants_for_NO', &
UNITS = 's^-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
RC=STATUS )
VERIFY_(STATUS)
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'surfEmissForChem', &
LONG_NAME = 'surface_emission_for_chemistry', &
UNITS = 'kg m-2 s-1', &
DIMS = MAPL_DimsHorzOnly, &
VLOCATION = MAPL_VLocationNone, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)
! Aerosol Surface Area Densities (SAD) bundle.
! --------------------------------------------
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'gmiSAD', &
LONG_NAME = 'surface_area_densities', &
UNITS = 'cm^2/cm^3', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)
! Photolysis Rate Constants bundle.
! --------------------------------
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'gmiQJ', &
LONG_NAME = 'photolysis_rate_constants', &
UNITS = 'cm3 s-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'gmiQQJ', &
LONG_NAME = 'photolysis_reaction_rates', &
UNITS = 'cm-3 s-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)
! Thermal Rate Constants bundle.
! --------------------------------
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'gmiQK', &
LONG_NAME = 'thermal_rate_constants', &
UNITS = '2-3body_varies', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'gmiQQK', &
LONG_NAME = 'thermal_reaction_rates', &
UNITS = 'cm-3 s-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)
! Aerosol or Dust Radii bundle.
! -----------------------------
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'gmiERADIUS', &
LONG_NAME = 'Aerosol_Dust_Radii', &
UNITS = 'cm', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
! Surface Area of Aerosol or Dust bundle.
! ---------------------------------------
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'gmiTAREA', &
LONG_NAME = 'surface_area_aerosol_dust', &
UNITS = 'cm^2/cm^3', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
DATATYPE = MAPL_BundleItem, &
RC=STATUS )
VERIFY_(STATUS)
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP10_NO2', &
LONG_NAME = 'Nitrogen_dioxide_10am_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_NO2', &
LONG_NAME = 'Nitrogen_dioxide_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP10_CH2O', &
LONG_NAME = 'Formaldehyde_10am_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_CH2O', &
LONG_NAME = 'Formaldehyde_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP10_CO', &
LONG_NAME = 'Carbon_monoxide_10am_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_CO', &
LONG_NAME = 'Carbon_monoxide_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP10_OX', &
LONG_NAME = 'Ozone_10am_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_OX', &
LONG_NAME = 'Ozone_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP10_CH4', &
LONG_NAME = 'Methane_10am_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_CH4', &
LONG_NAME = 'Methane_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_BrO', &
LONG_NAME = 'Bromine_monoxide_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_PAN', &
LONG_NAME = 'Peroxyacetyl_nitrate_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_ISOP', &
LONG_NAME = 'Isoprene_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_MOH', &
LONG_NAME = 'Methanol_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_HCOOH', &
LONG_NAME = 'Formic_Acid_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_N2O', &
LONG_NAME = 'Nitrous_oxide_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_HCl', &
LONG_NAME = 'Hydrochloric_acid_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_HNO3', &
LONG_NAME = 'Nitric_acid_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_ClO', &
LONG_NAME = 'Chlorine_monoxide_radical_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_CH3Cl', &
LONG_NAME = 'Methyl_chloride_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP10_NO', &
LONG_NAME = 'Nitric_oxide_10am_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_NO', &
LONG_NAME = 'Nitric_oxide_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_HOCl', &
LONG_NAME = 'Hypochlorous_acid_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_ClONO2', &
LONG_NAME = 'Chlorine_nitrate_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_Cl2O2', &
LONG_NAME = 'Chlorine_peroxide_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_Cl', &
LONG_NAME = 'Ground_state_atomic_chlorine_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_Cl2', &
LONG_NAME = 'Molecular_chlorine_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_OClO', &
LONG_NAME = 'Symmetrical_chlorine_dioxide_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_BrCl', &
LONG_NAME = 'Bromine_chloride_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_Br', &
LONG_NAME = 'Ground_state_atomic_bromine_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_BrONO2', &
LONG_NAME = 'Bromine_nitrate_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_HBr', &
LONG_NAME = 'Hydrogen_bromide_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_HOBr', &
LONG_NAME = 'Hypobromous_acid_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_HNO3COND', &
LONG_NAME = 'Condensed_nitric_acid_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &
VLOCATION = MAPL_VLocationCenter, &
__RC__ )
CALL MAPL_AddExportSpec(GC, &
SHORT_NAME = 'OVP14_OH', &
LONG_NAME = 'Hydroxyl_radical_2pm_local', &
UNITS = 'mol mol-1', &
DIMS = MAPL_DimsHorzVert, &