Difference between revisions of "Solution to UKCA Chemistry and Aerosol Tutorial 5 Task 5.1"

From UKCA
m (Protected "Solution to UKCA Chemistry and Aerosol Tutorial 5 Task 5.1" ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[UKCA Chemistry and Aerosol Tutorials | Back to UKCA Chemistry and Aerosol Tutorials]]
 
[[UKCA Chemistry and Aerosol Tutorials | Back to UKCA Chemistry and Aerosol Tutorials]]
   
[[UKCA Chemistry and Aerosol Tutorial 5#Task_5.1: Make slots for two new tracers | Back to the adding new chemical tracers tutorial]]
+
[[UKCA Chemistry and Aerosol Tutorial 5#Task 5.1: Create a new emissions file and use it in your job | Back to the adding new chemical emissions tutorial]]
   
 
==Task==
 
==Task==
   
You were asked to
+
You were asked to
   
 
<blockquote>
 
<blockquote>
  +
In the <pre>/work/n02/n02/ukca/Tutorial/vn8.4/Task5.1</pre> directory on ARCHER, or the <strike><pre>/projects/ukca/Tutorial/vn8.4/Task5.1</pre></strike> directory on MONSooN, there is the file '''Emissions_of_ALICE.nc''' which is a 0.5x0.5 degree resolution surface emission field. You should regrid this file to '''N96''', and then make a new surface emissions ancillary file with this as slot '''316'''. You should then use this new file, and the corresponding user STASHmaster file, in your UMUI job.
Add in two new tracers in to slots 64 and 65. The tracer in slot 64 will be called '''ALICE''' and the tracer in slot 65 will be called '''BOB'''. You should also output these two tracers through the '''pb/UPB''' stream in STASH as daily means.
 
 
</blockquote>
 
</blockquote>
   
 
==Solution==
 
==Solution==
   
  +
Before you start you should make a new directory to hold your files. For ease, this should be on the '''/work''' directory on ARCHER, and the '''/projects''' directory if you are using MONSooN.
===1. The user STASHmaster file===
 
   
  +
===Regrid your emissions dataset===
Go to '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; User-STASHmaster files. Diags, Progs & Ancills.'''. In this panel you will see that a number of user STASHmaster files listed. The one containing the tracers is ''UKCA_Tr_StratTrop.prestash''.
 
   
  +
[[Image:Xconv_Regridded.png|thumb|300px|right|Figure 1: Comparison of the 0.5x0.5 degree data and the N96 regridded data. Note the shift in the grid introduced by changing the ''first longitude'' from -179.5 to 0.0.]]
Take a copy of the '''UKCA_Tr_StratTrop.prestash''' user STASHmaster file, which can be found at
 
  +
Open the ''Emissions_of_ALICE.nc'' file using Xconv. Select the field (called "Emissions of ALICE in kg/m^2/s") and click on the '''Trans''' button on the top right of the GUI. You should then
   
  +
# Select '''area weighted interpolation''' (the second option down)
/home/ukca/userprestash/VN8.2/UKCA_Tr_StratTrop.prestash
 
  +
# You should then scroll down this panel and
  +
## Set the number of columns to 192
  +
## Set the first longitude to 0.000000
  +
## Set the column spacing to 1.875000
  +
## Set the number of rows to 145
  +
## Set the first latitude to -90.000000 (i.e. the South Pole)
  +
## Set the row spacing to 1.250000
   
  +
Now click '''Apply'''. The window should read
on PUMA, and copy it to your own directory. Edit this file to add the lines
 
  +
  +
Area weighted interpolation from 720x360 Regular grid to 192x145 Regular grid
  +
  +
and the '''nx''' and '''ny''' values should read 192 and 145. Now output this field to a netCDF file in your directory. A comparison of the 0.5x0.5 degree data and the N96 data can be seen in Figure 1.
  +
  +
An example of this file can be found at
  +
  +
/work/n02/n02/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_Emissions_of_ALICE_N96.nc
  +
  +
on ARCHER and at
  +
  +
<strike>/projects/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_Emissions_of_ALICE_N96.nc</strike>
  +
  +
on MONSooN.
  +
  +
===Make your new STASH item===
  +
  +
You are using the file
  +
  +
/home/ukca/userprestash/VN8.4/emiss_TCMIM_Aero.presm
  +
  +
on PUMA to define your emissions. Take a copy of this file and add the following entry just after field 315:
   
 
#
 
#
1| 1 | 34 | 64 |UKCA TUTORIAL TRACER: ALICE |
+
1| 1 | 0 | 316 |ALICE surf emissions |
2| 2 | 0 | 1 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 |
+
2| 2 | 0 | 1 | 1 | 5 | -1 | -1 | 0 | 0 | 0 | 0 |
3| 000000000000000000000000000064 | 00000000000000000001 | 1 |
+
3| 000000000000000000000000000000 | 00000000000000000001 | 3 |
 
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
 
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
5| 0 | 1861 | 0 | 65 | 0 | 0 | 0 | 0 | 0 |
+
5| 0 | 546 | 0 | 129 | 0 | 0 | 0 | 0 | 0 |
#
 
1| 1 | 34 | 65 |UKCA TUTORIAL TRACER: BOB |
 
2| 2 | 0 | 1 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 |
 
3| 000000000000000000000000000065 | 00000000000000000001 | 1 |
 
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
 
5| 0 | 1861 | 0 | 65 | 0 | 0 | 0 | 0 | 0 |
 
 
#
 
#
   
  +
Save this file and use it in your job in '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; User-STASHmaster files. Diags, Progs & Ancills'''.
An example file can be found at
 
   
  +
An example file can be found at
/home/ukca/userprestash/VN8.2/Tutorial/Task4.1_UKCA_Tr_StratTrop.prestash
 
   
  +
/home/ukca/userprestash/VN8.4/Tutorial/Task5.1_emiss_TCMIM_Aero.presm
===2. Initialise the new tracers===
 
   
Go to '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; Initialisation of User Prognostics''', scroll down the list of variables until you find your new tracers and set these to option '''3''' (i.e. zero).
+
Now go to '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; Initialisation of User Prognostics''' and set the '''Option''' column for this field to '''2'''.
   
  +
Copy this new STASHmaster file into the directory on the supercomputer that contains your regridded emissions data.
===3. Add the hand-edit===
 
   
  +
===Extract the original emissions data===
Run the '''/home/ukca/bin/make_tracer_list''' script on your user STASHmaster file to produce the following output
 
   
  +
Open the original emissions ancillary file. This can be found at
TC_UKCA=1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
 
1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,
 
1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,
 
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 
0,0,0,0,0,0,0,1,1,
 
TR_UKCA=74,
 
   
  +
/work/n02/n02/ukca/ANCILS/N96L85/AR5_2000_MEGAN-MeOH
You can make a hand-edit file like this
 
   
  +
on ARCHER and at
# Hand edit to add tracers for UKCA tutorial
 
# vn8.2 64:ALICE, 65:BOB
 
 
ed SIZES<<\EOF
 
/TC_UKCA=/
 
d
 
d
 
d
 
d
 
d
 
i
 
TC_UKCA=1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
 
1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,
 
1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,
 
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 
0,0,0,0,0,0,0,1,1,
 
.
 
w
 
q
 
EOF
 
 
ed SIZES<<\EOF
 
/TR_UKCA=/
 
d
 
i
 
TR_UKCA=74,
 
.
 
w
 
q
 
EOF
 
   
  +
<strike>/projects/ukca/inputs/ancil/N96L85/emiss/AR5_2000_MEGAN-MeOH</strike>
and make this script executable (<tt>chmod a+rx <span style="color:blue">script.ed</span></tt>).
 
   
  +
on MONSooN. Extract this data (using Xconv) to a new netCDF file in the same directory as your regridded data.
An example of this hand-edit can be found at
 
   
  +
===Make the new ancillary file===
/home/ukca/hand_edits/VN8.2/Tutorial/Task4.1_add_UKCA_Tr_StratTrop.ed
 
   
  +
In your directory on the supercomputer containing the two emissions netCDF files and your new user STASHmaster file load up Xancil. You should just be able to type
Add your hand-edit to the UMUI at '''Model Selection &rarr; Input/Output Control and Resource &rarr; User hand edit files''' by placing it in the table and putting a '''Y''' in the ''Include Y/N'' column.
 
   
  +
xancil
===Changes to STASH===
 
   
  +
on the command-line, but the full path is
Go to the STASH panel at '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; STASH. Specification of Diagnostic requirements''' and go to '''Diagnostics &rarr; Load New Diagnostics''' and scroll down the list until you come to section '''34''' and double-click where it says '''UKCA Chemistry'''. Scroll down the list until you get to the ALICE and BOB tracers, and add them to STASH like so
 
   
  +
/work/n02/n02/hum/bin/xancil
34 64 UKCA TUTORIAL TRACER: ALICE TDAYM DALLTH UPB Y + N X
 
34 65 UKCA TUTORIAL TRACER: BOB TDAYM DALLTH UPB Y + N X
 
   
  +
on ARCHER and
You will see that the final two columns say ''N'' (''Avail'') and ''X'' (''I+P+A''). This is because STASH thinks that these tracers are not available as they are not turned on until the ''Process'' stage when the hand-edit defined above is applied. Also, if you verify diagnostics you get the following warning
 
   
  +
/projects/um1/linux/bin/xancil
Diag: "UKCA TUTORIAL TRACER: ALICE " (34,64) (TDAYM,DALLTH,UPB)
 
  +
DIAGNOSTIC ERROR: Diagnostic is not available for this model configuration.
 
  +
on the MONSooN postproc.
Diag: "UKCA TUTORIAL TRACER: BOB " (34,65) (TDAYM,DALLTH,UPB)
 
  +
DIAGNOSTIC ERROR: Diagnostic is not available for this model configuration.
 
  +
On loading this up, go to the '''Xancil &rarr; Configuration &rarr; General Configuration''' and set
  +
  +
* The UM version to '''8.4'''
  +
* Set to output '''well-formed ancillary files'''
  +
* Input the netCDF files and STASHmaster files that you have created
  +
  +
Now go to '''Xancil &rarr; Atmosphere Ancillary Files &rarr; Single-level User Fields'''
  +
  +
* Set to '''create''' this file
  +
* Set the '''name''' to one of your choosing
  +
* Set to '''specify the file dates'''
  +
* Increase the number of ''' ancillary fields''' to '''16'''
  +
* For each of the 16 fields you will need to
  +
** Set the '''netCDF file'''. For the first 15 this will be the file containing the fields extracted from ''AR5_2000_MEGAN-MeOH'', and for field 16 this will be your regridded ALICE emissions field
  +
** Set the '''STASH code''' to '''301-316''' for each of the 16 fields
  +
** '''Select''' the '''variable name'''. You should do (or at least confirm) this manually as Xconv may put the wrong field in a STASH slot
  +
  +
You can now '''Save''' this if you wish. Now click '''Create Anc. Files''' and your new ancillary file will be created.
  +
  +
An example ancillary file can be found at
  +
  +
/work/n02/n02/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_AR5_2000.anc
  +
  +
on ARCHER and at
  +
  +
<strike>/projects/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_AR5_2000.anc</strike>
  +
  +
on MONSooN. A corresponding Xancil job file can be found at
  +
  +
/work/n02/n02/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_Xancil.job
  +
  +
on ARCHER and at
  +
  +
<strike>/projects/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_Xancil.job</strike>
  +
  +
on MONSooN.
   
  +
===Use your new Ancillary File in the UMUI===
However, you should not worry about this, as the tracers are available and will be output. However, they will contain zeros as nothing has been placed into them (yet).
 
   
  +
Go to '''Model Selection &rarr; Atmosphere &rarr; Ancillary and input data files &rarr; Climatologies & potential climatologies &rarr; User single-level ancillary file & fields''' and set the '''Directory name or Environment Variable''' box to the directory containing the new ancillary file, and set the name in the '''file name''' box to the file name of your file.
'''Note:''' If you find that you get this error message, but with different names (although the section and item numbers are the same) then you should '''save''' your job and '''close''' it. Now when you re-open it and open the STASH panel again you will find that the names have been updated. This occurs because STASH only reads the user STASHmaster files the first time the panel is opened (in that job instance) so you must re-load the job for the changes to properly take effect.
 
   
 
==Output==
 
==Output==
   
If you open the '''pb''' file in your '''[[UKCA & UMUI Tutorials: Things to know before you start#Archiving|archive]]''' directory you will find that it now contains the fields
+
If you open the '''pa''' file in your job directory you will find that it still contains the fields
   
 
0 : 192 145 85 1 Stash code = 34001
 
0 : 192 145 85 1 Stash code = 34001
Line 123: Line 148:
 
2 : 192 145 85 1 Stash code = 34065
 
2 : 192 145 85 1 Stash code = 34065
   
If you open 34064 and 34065 you will find that they only contain zeros.
+
If you open 34064 and 34065 you will find that they still only contain zeros. This will change in the next task as we allow UKCA to take the emissions from this ancillary file and add them to the ALICE tracer.
   
 
'''Sample output''' from this job can be found in
 
'''Sample output''' from this job can be found in
   
/work/n02/n02/ukca/Tutorial/sample_output/Task4.1/
+
/work/n02/n02/ukca/Tutorial/vn8.4/sample_output/Task5.1/
   
on HECToR, and in
+
on ARCHER, and in
   
/projects/ukca/Tutorial/sample_ouput/Task4.1/
+
<strike>/projects/ukca/Tutorial/vn8.4/sample_ouput/Task5.1/</strike>
   
 
on MONSooN.
 
on MONSooN.
Line 137: Line 162:
 
==Worked Solution==
 
==Worked Solution==
   
There is a worked solution to this problem in the UMUI Tutorial experiment. This is job '''d''': ''Tutorial: solution to Task 5.1 - adding new chemical tracers to the UMUI''.
+
There is a worked solution to this problem in the UMUI Tutorial experiment. This is job '''e''': ''Tutorial: solution to Task 5.1 - adding a new chemical emissions ancillary file''.
   
 
----
 
----

Latest revision as of 15:10, 15 December 2015

Back to UKCA Chemistry and Aerosol Tutorials

Back to the adding new chemical emissions tutorial

Task

You were asked to

In the

/work/n02/n02/ukca/Tutorial/vn8.4/Task5.1

directory on ARCHER, or the

/projects/ukca/Tutorial/vn8.4/Task5.1

directory on MONSooN, there is the file Emissions_of_ALICE.nc which is a 0.5x0.5 degree resolution surface emission field. You should regrid this file to N96, and then make a new surface emissions ancillary file with this as slot 316. You should then use this new file, and the corresponding user STASHmaster file, in your UMUI job.

Solution

Before you start you should make a new directory to hold your files. For ease, this should be on the /work directory on ARCHER, and the /projects directory if you are using MONSooN.

Regrid your emissions dataset

Figure 1: Comparison of the 0.5x0.5 degree data and the N96 regridded data. Note the shift in the grid introduced by changing the first longitude from -179.5 to 0.0.

Open the Emissions_of_ALICE.nc file using Xconv. Select the field (called "Emissions of ALICE in kg/m^2/s") and click on the Trans button on the top right of the GUI. You should then

  1. Select area weighted interpolation (the second option down)
  2. You should then scroll down this panel and
    1. Set the number of columns to 192
    2. Set the first longitude to 0.000000
    3. Set the column spacing to 1.875000
    4. Set the number of rows to 145
    5. Set the first latitude to -90.000000 (i.e. the South Pole)
    6. Set the row spacing to 1.250000

Now click Apply. The window should read

Area weighted interpolation from 720x360 Regular grid to 192x145 Regular grid

and the nx and ny values should read 192 and 145. Now output this field to a netCDF file in your directory. A comparison of the 0.5x0.5 degree data and the N96 data can be seen in Figure 1.

An example of this file can be found at

/work/n02/n02/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_Emissions_of_ALICE_N96.nc

on ARCHER and at

/projects/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_Emissions_of_ALICE_N96.nc

on MONSooN.

Make your new STASH item

You are using the file

/home/ukca/userprestash/VN8.4/emiss_TCMIM_Aero.presm

on PUMA to define your emissions. Take a copy of this file and add the following entry just after field 315:

#
1|    1 |    0 |  316 |ALICE surf emissions                |
2|    2 |    0 |    1 |    1 |    5 |   -1 |   -1 |    0 |    0 |    0 |    0 |
3| 000000000000000000000000000000 | 00000000000000000001 |    3 |
4|    1 |    0 | -99  -99  -99  -99  -99  -99  -99  -99  -99  -99 |
5|    0 |  546 |    0 |  129 |    0 |    0 |    0 |    0 |    0 |
#

Save this file and use it in your job in Model Selection → Atmosphere → STASH → User-STASHmaster files. Diags, Progs & Ancills.

An example file can be found at

/home/ukca/userprestash/VN8.4/Tutorial/Task5.1_emiss_TCMIM_Aero.presm

Now go to Model Selection → Atmosphere → STASH → Initialisation of User Prognostics and set the Option column for this field to 2.

Copy this new STASHmaster file into the directory on the supercomputer that contains your regridded emissions data.

Extract the original emissions data

Open the original emissions ancillary file. This can be found at

/work/n02/n02/ukca/ANCILS/N96L85/AR5_2000_MEGAN-MeOH

on ARCHER and at

/projects/ukca/inputs/ancil/N96L85/emiss/AR5_2000_MEGAN-MeOH

on MONSooN. Extract this data (using Xconv) to a new netCDF file in the same directory as your regridded data.

Make the new ancillary file

In your directory on the supercomputer containing the two emissions netCDF files and your new user STASHmaster file load up Xancil. You should just be able to type

xancil

on the command-line, but the full path is

/work/n02/n02/hum/bin/xancil

on ARCHER and

/projects/um1/linux/bin/xancil

on the MONSooN postproc.

On loading this up, go to the Xancil → Configuration → General Configuration and set

  • The UM version to 8.4
  • Set to output well-formed ancillary files
  • Input the netCDF files and STASHmaster files that you have created

Now go to Xancil → Atmosphere Ancillary Files → Single-level User Fields

  • Set to create this file
  • Set the name to one of your choosing
  • Set to specify the file dates
  • Increase the number of ancillary fields to 16
  • For each of the 16 fields you will need to
    • Set the netCDF file. For the first 15 this will be the file containing the fields extracted from AR5_2000_MEGAN-MeOH, and for field 16 this will be your regridded ALICE emissions field
    • Set the STASH code to 301-316 for each of the 16 fields
    • Select the variable name. You should do (or at least confirm) this manually as Xconv may put the wrong field in a STASH slot

You can now Save this if you wish. Now click Create Anc. Files and your new ancillary file will be created.

An example ancillary file can be found at

/work/n02/n02/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_AR5_2000.anc

on ARCHER and at

/projects/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_AR5_2000.anc

on MONSooN. A corresponding Xancil job file can be found at

/work/n02/n02/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_Xancil.job

on ARCHER and at

/projects/ukca/Tutorial/vn8.4/Task5.1/solution/Task5.1_Xancil.job

on MONSooN.

Use your new Ancillary File in the UMUI

Go to Model Selection → Atmosphere → Ancillary and input data files → Climatologies & potential climatologies → User single-level ancillary file & fields and set the Directory name or Environment Variable box to the directory containing the new ancillary file, and set the name in the file name box to the file name of your file.

Output

If you open the pa file in your job directory you will find that it still contains the fields

0    : 192   145   85    1     Stash code = 34001
1    : 192   145   85    1     Stash code = 34064
2    : 192   145   85    1     Stash code = 34065

If you open 34064 and 34065 you will find that they still only contain zeros. This will change in the next task as we allow UKCA to take the emissions from this ancillary file and add them to the ALICE tracer.

Sample output from this job can be found in

/work/n02/n02/ukca/Tutorial/vn8.4/sample_output/Task5.1/

on ARCHER, and in

/projects/ukca/Tutorial/vn8.4/sample_ouput/Task5.1/

on MONSooN.

Worked Solution

There is a worked solution to this problem in the UMUI Tutorial experiment. This is job e: Tutorial: solution to Task 5.1 - adding a new chemical emissions ancillary file.


Written by Luke Abraham 2014