Difference between revisions of "Solution to UKCA & UMUI Tutorial 4 Task 4.2"
Line 21: | Line 21: | ||
===Changes to ukca_setd1defs.F90=== |
===Changes to ukca_setd1defs.F90=== |
||
+ | |||
+ | The value of '''n_chem_tracers''' need to be increased from 71 to '''73'''. |
||
The '''nm_spec''' array has been edited to add in the ALICE and BOB tracers (changes in <span style="color:red">red</span>): |
The '''nm_spec''' array has been edited to add in the ALICE and BOB tracers (changes in <span style="color:red">red</span>): |
||
Line 81: | Line 83: | ||
WHERE (advt == 'ALICE ') c_species = C_ALICE |
WHERE (advt == 'ALICE ') c_species = C_ALICE |
||
WHERE (advt == 'BOB ') c_species = C_BOB |
WHERE (advt == 'BOB ') c_species = C_BOB |
||
+ | |||
+ | ===Hand-edit to increase values of JPCTR and JPSPEC=== |
||
+ | |||
+ | A hand-edit is required to increase the values of '''JPCTR''' and '''JPSPEC'''. This should contain the following: |
||
+ | |||
+ | ed CNTLATM<<\EOF |
||
+ | /JPCTR/ |
||
+ | d |
||
+ | i |
||
+ | JPCTR = 73, |
||
+ | . |
||
+ | /JPSPEC/ |
||
+ | d |
||
+ | i |
||
+ | JPSPEC = 77, |
||
+ | . |
||
+ | w |
||
+ | q |
||
+ | EOF |
||
+ | |||
+ | An example can be found at |
||
+ | |||
+ | /home/ukca/hand_edits/VN8.2/Tutorial/Task4.2_incr_JPvals.ed |
||
==Worked Solution== |
==Worked Solution== |
Revision as of 16:47, 17 June 2013
Back to the adding new chemical tracers tutorial
Task
You were asked to
Make the required code changes so that your ALICE and BOB tracers are now specified in the UKCA CheST/StratTrop scheme. You should set the conversion factor for each of these to 1.0.
Solution
The solution to this task involves making changes to 4 files in the UKCA sub-directory of your source code. These files are
ukca_setd1defs.F90 ukca_chem_strattrop.F90 ukca_constants.F90 ukca_cspecies.F90
The following changes need to be made
Changes to ukca_setd1defs.F90
The value of n_chem_tracers need to be increased from 71 to 73.
The nm_spec array has been edited to add in the ALICE and BOB tracers (changes in red):
nm_spec(1:n_all_tracers) = (/ & 'O3 ','NO ','NO3 ','NO2 ','N2O5 ', & 'HO2NO2 ','HONO2 ','H2O2 ','CH4 ','CO ', & !10 'HCHO ','MeOOH ','HONO ','C2H6 ','EtOOH ', & 'MeCHO ','PAN ','C3H8 ','n-PrOOH ','i-PrOOH ', & !20 'EtCHO ','Me2CO ','MeCOCH2OOH','PPAN ','MeONO2 ', & 'O3_S ','C5H8 ','ISOOH ','ISON ','MACR ', & !30 'MACROOH ','MPAN ','HACET ','MGLY ','NALD ', & 'HCOOH ','MeCO3H ','MeCO2H ','H2O ','ISO2 ', & !40 'Cl ','ClO ','Cl2O2 ','OClO ','Br ', & 'BrO ','BrCl ','BrONO2 ','N2O ','HCl ', & !50 'HOCl ','HBr ','HOBr ','ClONO2 ','CFCl3 ', & 'CF2Cl2 ','MeBr ','N ','O(3P) ','MACRO2 ', & !60 'MeCl ','CF2ClBr ','CCl4 ','ALICE ','BOB ', & 'MeCCl3 ','CF3Br ','H2OS ','CH2Br2 ','H2 ', & !70 'DMS ','SO2 ','H2SO4 ','MSA ','DMSO ', & 'NH3 ','CS2 ','COS ','H2S ','H ', & !80 'OH ','HO2 ','MeOO ','EtOO ','MeCO3 ', & 'n-PrOO ','i-PrOO ','EtCO3 ','MeCOCH2OO ','MeOH ', & !90 'Monoterp ','Sec_Org ','SESQUITERP','SO3 ','AROM ', & 'O(3P)_S ','O(1D)_S ','NO2 ','BrO ','HCl ', & !100 'ND_Nuc_SOL','Nuc_SOL_SU','ND_Ait_SOL','Ait_SOL_SU','Ait_SOL_BC', & 'Ait_SOL_OC','ND_Acc_SOL','Acc_SOL_SU','Acc_SOL_BC','Acc_SOL_OC', & !110 'Acc_SOL_SS','Acc_SOL_DU','ND_Cor_SOL','Cor_SOL_SU','Cor_SOL_BC', & 'Cor_SOL_OC','Cor_SOL_SS','Cor_SOL_DU','ND_Ait_INS','Ait_INS_BC', & !120 'Ait_INS_OC','ND_Acc_INS','Acc_INS_DU','ND_Cor_INS','Cor_INS_Du', & 'Nuc_SOL_OC','Ait_SOL_SS','Nuc_SOL_OZ','Ait_SOL_OZ','Acc_SOL_OZ', & !130 'Cor_SOL_OZ','Nuc_SOL_NH','Ait_SOL_NH','Acc_SOL_NH','Cor_SOL_NH', & 'Nuc_SOL_NT','Ait_SOL_NT','Acc_SOL_NT','Cor_SOL_NT','XXX ', & !140 'Anth_Prec ','Bio_Prec ','Anth_Cond ','Bio_Cond ','XXX ', & 'XXX ','XXX ','XXX ','PASSIVE O3','AGE OF AIR' & !150 /)
Changes to ukca_chem_strattrop.F90
The following lines have been added to the end of the chch_defs_strattrop_chem specification:
chch_t( 76,'ALICE ', 1,'TR ',' ', 0, 0, 0), & ! 76 chch_t( 77,'BOB ', 1,'TR ',' ', 0, 0, 0) & ! 77
(also, a comma has been added after the final ")" on line 75, specifying N2). The size of the chch_defs_strattrop_chem array has been increased from 75 to 77.
Changes to ukca_constants.F90
The following lines have been added to the UKCA_CONSTANTS module:
! UKCA Tutorial tracers REAL, PARAMETER :: C_ALICE = 1.0000 REAL, PARAMETER :: C_BOB = 1.0000
Changes to ukca_cspecies.F90
The following lines have been added to the UKCA_CALC_CSPECIES subroutine which is held within the UKCA_CSPECIES module
! UKCA Tutorial Tracers WHERE (advt == 'ALICE ') c_species = C_ALICE WHERE (advt == 'BOB ') c_species = C_BOB
Hand-edit to increase values of JPCTR and JPSPEC
A hand-edit is required to increase the values of JPCTR and JPSPEC. This should contain the following:
ed CNTLATM<<\EOF /JPCTR/ d i JPCTR = 73, . /JPSPEC/ d i JPSPEC = 77, . w q EOF
An example can be found at
/home/ukca/hand_edits/VN8.2/Tutorial/Task4.2_incr_JPvals.ed
Worked Solution
There is a worked solution to this problem in the UMUI Tutorial experiment. This is job d: Tutorial: solution to Task 4.2 - adding new chemical tracers to UKCA.
The code changes can be viewed by using the following FCM command
fcm diff -g fcm:um_br/dev/luke/vn8.2_UKCA_Tutorial_Solns@12143 fcm:um_br/dev/luke/vn8.2_UKCA_Tutorial_Solns@
This gives the following (non-graphical) output:
Written by Luke Abraham 2013