-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chemistry preprocessor compiler fixes for Cori #3045
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
BEGSIM | ||
output_unit_number = 7 | ||
output_file = linoz_mam4_resus_mom_soag.doc | ||
procout_path = ../output/ | ||
src_path = ../bkend/ | ||
procfiles_path = ../procfiles/cam/ | ||
sim_dat_path = ../output/ | ||
sim_dat_filename = linoz_mam4_resus_mom_soag.dat | ||
|
||
Comments | ||
E3SMv1 DECK chemistry. | ||
End Comments | ||
|
||
SPECIES | ||
|
||
Solution | ||
O3 | ||
H2O2, H2SO4, SO2, DMS -> CH3SCH3, SOAG -> C | ||
so4_a1 -> NH4HSO4 | ||
pom_a1 -> C, soa_a1 -> C, bc_a1 -> C | ||
dst_a1 -> AlSiO5, ncl_a1 -> NaCl | ||
mom_a1 -> C8520H11360O8520 | ||
num_a1 -> H | ||
so4_a2 -> NH4HSO4 | ||
soa_a2 -> C, ncl_a2 -> NaCl | ||
mom_a2 -> C8520H11360O8520 | ||
num_a2 -> H | ||
dst_a3 -> AlSiO5, ncl_a3 -> NaCl | ||
so4_a3 -> NH4HSO4 | ||
bc_a3 -> C, pom_a3 -> C | ||
soa_a3 -> C | ||
mom_a3 -> C8520H11360O8520 | ||
num_a3 -> H | ||
pom_a4 -> C, bc_a4 -> C | ||
mom_a4 -> C8520H11360O8520 | ||
num_a4 -> H | ||
End Solution | ||
|
||
Fixed | ||
M, N2, O2, H2O, OH, NO3, HO2, cnst_O3 -> O3 | ||
End Fixed | ||
|
||
Col-int | ||
O3 = 0. | ||
O2 = 0. | ||
End Col-int | ||
|
||
End SPECIES | ||
|
||
Solution Classes | ||
Explicit | ||
O3 | ||
End Explicit | ||
Implicit | ||
H2O2, H2SO4, SO2, DMS, SOAG | ||
so4_a1, pom_a1 | ||
soa_a1, bc_a1, dst_a1, ncl_a1 | ||
mom_a1 | ||
num_a1 | ||
so4_a2, soa_a2, ncl_a2, mom_a2, num_a2 | ||
dst_a3, ncl_a3, so4_a3 | ||
bc_a3, pom_a3, soa_a3, mom_a3, num_a3 | ||
pom_a4, bc_a4, mom_a4, num_a4 | ||
End Implicit | ||
End Solution Classes | ||
|
||
CHEMISTRY | ||
Photolysis | ||
[jh2o2] H2O2 + hv -> | ||
End Photolysis | ||
|
||
Reactions | ||
[usr_HO2_HO2] HO2 + HO2 -> H2O2 | ||
H2O2 + OH -> H2O + HO2 ; 2.9e-12, -160 | ||
[usr_SO2_OH] SO2 + OH -> H2SO4 | ||
DMS + OH -> SO2 ; 9.6e-12, -234. | ||
[usr_DMS_OH] DMS + OH -> .5 * SO2 + .5 * HO2 | ||
DMS + NO3 -> SO2 + HNO3 ; 1.9e-13, 520. | ||
End Reactions | ||
|
||
Ext Forcing | ||
SO2 <- dataset | ||
so4_a1 <- dataset | ||
so4_a2 <- dataset | ||
pom_a4 <- dataset | ||
bc_a4 <- dataset | ||
num_a1 <- dataset | ||
num_a2 <- dataset | ||
num_a4 <- dataset | ||
SOAG <- dataset | ||
End Ext Forcing | ||
|
||
END CHEMISTRY | ||
|
||
SIMULATION PARAMETERS | ||
|
||
Version Options | ||
model = cam | ||
machine = intel | ||
architecture = hybrid | ||
vec_ftns = on | ||
multitask = on | ||
namemod = on | ||
modules = on | ||
End Version Options | ||
|
||
END SIMULATION PARAMETERS | ||
|
||
ENDSIM |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,8 @@ program mozart_pp | |
sim_dat_filename = 'sim.dat' | ||
sim_dat_filespec = trim(sim_dat_path) // 'sim.dat' | ||
cpp_dir = ' ' | ||
cpp_opts = '-P -C -I.' | ||
! cpp_opts = '-P -C -I.' ! -C causes problems on Cori | ||
cpp_opts = '-P -I. -traditional-cpp' ! Works on Cori (2019-07-15) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can just remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you diff the fortran files to those archived in src/chemistry ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My personal preference is to leave in (as comments) things that may be relevant to getting the pre-processor to work an another machine. It is a cheap alternative to IF statements for different machines. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. Lets keep it the way it is. |
||
|
||
!----------------------------------------------------------------------- | ||
! ... Assign default input, output units | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/csh | ||
|
||
### This version Cori 2017-07-206. | ||
|
||
set exenam=cam_chempp | ||
set objdir=OBJ | ||
|
||
rm -f ../bin/$exenam | ||
rm -f $objdir/* | ||
|
||
mkdir -p $objdir | ||
mkdir -p ../bin | ||
|
||
# When running the eventual binary it wants to write into a various | ||
# directories, but it dies if those directories don't exist. The easy | ||
# solution is to create the default directories here. This will fail | ||
# if a non-standard directory is used, but this seems pretty safe. | ||
mkdir -p ../tmp | ||
mkdir -p ../output | ||
|
||
#gmake COMPILER=lf95 DEBUG=TRUE EXENAME=cam_chempp | ||
|
||
###For Cori: | ||
module unload PrgEnv-pgi | ||
module unload PrgEnv-cray | ||
module unload PrgEnv-gnu | ||
module unload PrgEnv-intel | ||
|
||
#module load PrgEnv-pgi | ||
#gmake COMPILER=pgf95 DEBUG=TRUE EXENAME=cam_chempp | ||
|
||
#module load PrgEnv-pgi | ||
#gmake COMPILER=gfortran DEBUG=TRUE EXENAME=cam_chempp | ||
|
||
#module load PrgEnv-intel | ||
#gmake COMPILER=ifort DEBUG=TRUE EXENAME=cam_chempp | ||
|
||
#module load PrgEnv-cray | ||
#gmake COMPILER=ftn DEBUG=TRUE EXENAME=cam_chempp | ||
|
||
module load PrgEnv-gnu | ||
gmake COMPILER=gfortran DEBUG=TRUE EXENAME=cam_chempp | ||
|
||
# --- end of file --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know about this
-J
flag. The code works without this new addition. Is there a reason this was added?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -J flag controls where the intermediate compiled files go. Without the -J flag they clogged up the src directory. The -J flag puts them in a separate directory $(OBJ_DIR), which I think has been the historical place for them. Hence, it is not strictly necessary, but it is valuable and increases consistency across different compilers without any downside. Hence, I recommend we keep it in the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It works for gfortran but it doesn't do anything if we use Intel. Line 143 above (
# FFLAGS := -g -c -ffree-form
) is not doing anything. Is it okay if I remove it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you can remove the commented line. I was keeping it while I was testing new options. Since I ended up just adding an extra option (-J) there seems little value in keeping the original line around. Can you remove it? Or do you need me to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just removed the commented out line, for clarity.