Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Problem building with COSP in CESM1.0.6

I am attempting to run some simulations using CESM1.0.6 with CAM5 with COSP enabled. I am using the F_AMIP_CAM5 compset. Right now, I am just trying to get any configuration with COSP up and running. Following is description of the steps I am taking relating to the COSP test case. I am compiling with the intel12.1.5 compiler on a yellowstone login node. Can anyone tell me where I am going wrong?1. Create the case.
/glade/p/cesm/releases/cesm1_0_6/scripts/create_newcase -case ./cesm1_0_6.f.test_cosp -res f19_f19 -compset F_AMIP_CAM5 -mach yellowstone2. Edit "CAM_CONFIG_OPTS" in env_conf.xml to be "-phys cam5 -cosp"
Add cosp related fields to a newly created user_nl_cam file
&cospsimulator_nl
docosp=.true.
cosp_amwg=.true.
/3. Configure the case
./configure -case4. Build the case
./cesm1_0_6.f.test_cosp.yellowstone.buildAt this point, the case compiles until it reaches the first COSP file at which point the build crashes./glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/physics/cosp/MISR_simulator/MISR_simulator.f90(24): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: * )       SUBROUTINE MISR_simulator(--------------------------------^...(other similar errors about syntax or erroneous parethesis use).../tmp/ifortPrjI0g.i90(160): catastrophic error: Too many errors, exitingcompilation aborted for /glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/physics/cosp/MISR_simulator/MISR_simulator.f90 (code 1)gmake: *** [MISR_simulator.o] Error 1gmake: *** Waiting for unfinished jobs....I have gotten COSP to run in CESM1.1.1, CESM1.1.2, and CESM1.2.2, but I would really like to use 1.0.6 for my current simulations as it is the only version with a scientifically validated F_AMIP_CAM5 compset. I have more experience with the 1.1z and 1.2.z configuration proceduces than the 1.0.z procedures. Thus, I am unsure if I am perhaps just doing something out of order. 
 

eaton

CSEG and Liaisons
I can build this configuration successfully using a CAM
standalone build.  The problem in the CESM scripts is that the
special Makefile rules for building the COSP code are not being
found.  Early CESM releases built the COSP code as part of the
atm library, and provided a bunch of special Makefile rules for
the COSP files.  The CAM standalone build allows COSP to build
itself using its own Makefile (current CESM releases do this as
well).

The source in MISR_simulator.f90 is fixed format, but
the "-fixed" flag that the compiler needs is not part of the
command that's being issued for the compilation.

Hopefully someone more versed in the CESM build details can help
find the missing special rules and get you back on track.
 

santos

Member
Hmm. CESM did not support COSP properly in the 1.0 build scripts (and it was not regression tested), but for a couple of machines there were rules in the Macros file that seem to have worked. Try this Macros.yellowstone file in one of your cases with COSP:~santos/tmp/Macros.yellowstoneI simply copied the COSP section out of the hopper Macros file, since there doesn't actually seem to be anything machine-specific in it. If that works I will post it on the forum here.
 
I am still getting the same error as before. Following is the directory for the case I am atempting to build. I have also attached the atm.bldlog file from this attempt in case it proves useful in diagnosing the issue./glade/u/home/woelfle/cases/spookie_rerun/cesm1_0_6.f.test_cosp2I have also tried the fix for CESM1.1.1 which recommended copying the mkDepends file from the CAM build to the Tools directory. This made no difference. 
 

santos

Member
Ah, I see, the "-fixed" flag was missing from the file as well as the COSP part. I've edited the version in /glade/u/home/santos/tmp so try copying that again.
 
I have attempted building again with the new flag, and received a different error:/glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/physics/cam/ppgrid.F90(32): error #6404: This name does not have a type, and must have an explicit type.   [PLEV]   parameter (pver   = PLEV)-----------------------^compilation aborted for /glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/physics/cam/ppgrid.F90 (code 1)gmake: *** [ppgrid.o] Error 1gmake: *** Waiting for unfinished jobs..../glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/control/pspect.F90(10): error #6772: A PARAMETER must not be defined in terms of itself.   [PTRM]   integer, parameter :: ptrm = PTRM                ! M truncation parameter--------------------------------^/glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/control/pspect.F90(11): error #6772: A PARAMETER must not be defined in terms of itself.   [PTRN]   integer, parameter :: ptrn = PTRN                ! N truncation parameter--------------------------------^/glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/control/pspect.F90(12): error #6772: A PARAMETER must not be defined in terms of itself.   [PTRK]   integer, parameter :: ptrk = PTRK                ! K truncation parameter--------------------------------^compilation aborted for /glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/control/pspect.F90 (code 1) The full build log is attached.  
 

santos

Member
Sorry; it's probably obvious, but it's been a long time since I've modified CESM 1.0 build scripts.What you need to do is to back up to configure -cleanmach (or just make a new case). After doing configure again, look for the Macros.yellowstone in your case directory and remove everything after this line:# The following always need to be setThen append my version of Macros.yellowstone to that file, replacing whan you just removed. The reason is that you need the part of the file generated by configure based on your case details, but the Macros file that I have corrects the generic settings that should always be valid (and adds COSP).
 
I just successfully built and ran a test case using COSP after making these changes. Thank you for the help. The details on how to modify the Macro file in your last post was very helpful.
 

santos

Member
Since it worked for you, I'll post this for anyone else with the same issue. Whenever we do another compatibility/fix release for CESM 1.0, hopefully this should be fixed.
 
Hi,I also get the same error (please see below) when building even after downloading and replacing my Macro file with the one last updated on May 13.  Does anybody know what could be causing this issue when building? Thanks,Ivy /glade/p/cesm/releases/cesm1_0_5/models/atm/cam/src/dynamics/fv/pmgrid.F90(26): error #6772: A PARAMETER must not be defined in terms of itself.   [PLON]   integer, parameter :: plon   = PLON       ! number of longitudes----------------------------------^/glade/p/cesm/releases/cesm1_0_5/models/atm/cam/src/dynamics/fv/pmgrid.F90(27): error #6772: A PARAMETER must not be defined in terms of itself.   [PLEV]   integer, parameter :: plev   = PLEV       ! number of vertical levels----------------------------------^/glade/p/cesm/releases/cesm1_0_5/models/atm/cam/src/dynamics/fv/pmgrid.F90(28): error #6772: A PARAMETER must not be defined in terms of itself.   [PLAT]   integer, parameter :: plat   = PLAT       ! number of latitudes----------------------------------^/glade/p/cesm/releases/cesm1_0_5/models/atm/cam/src/utils/spmd_utils.F90(51): error #6418: This name has already been assigned a data type.   [MPI_STATUS_IGNORE]   integer :: mpi_status_ignore     ! Needs to be defined in mpi-serial--------------^compilation aborted for /glade/p/cesm/releases/cesm1_0_5/models/atm/cam/src/dynamics/fv/pmgrid.F90 (code 1)gmake: *** [pmgrid.o] Error 1gmake: *** Waiting for unfinished jobs....compilation aborted for /glade/p/cesm/releases/cesm1_0_5/models/atm/cam/src/utils/spmd_utils.F90 (code 1) gmake: *** [spmd_utils.o] Error 1
 
Just a quick update - I was able to successfully build the model on a local cluster, so it seems like an error specific to Yellowstone.  Help would be greatly appreciated!
 

jedwards

CSEG and Liaisons
Staff member
I see that you are using /glade/p/cesm/releases/cesm1_0_5    Is there a good reason you are not using 1.2.2?   If so can you try /glade/p/cesm/releases/cesm1_0_6?
 
Hi, thanks for your reply.  We have already started running with CESM1.0.5 for a while now and cannot switch model versions at this point because we are comparing pairs of simulations that need to be identical other than the specific changes we made.  Is there a way to get around the bug with CESM1.0.5?  Thanks!
 
Hi, after checking out CESM1.0.6, I think we can run with it.  I'm trying to build my code with CCSM_REPOTAG=cesm1_0_6, but when configuring my case (actually with CESM1.0.5 or with CESM1.0.6) the model is stuck at the configure stage and I get: Generating resolved namelist, prestage, and build scriptsphysics package: cam5 is still being tested                  with the COSP simulator I'm not even able to get the to the build stage at this point. 
 

eaton

CSEG and Liaisons
This is a message from CAM's configure utility.  It is informational only and does not cause the build to stop.  You need to dig further to find the reason the build is failing. 
 
Hi,I'm now running with the F_AMIP_CAM5 compset and I seem to be getting the following error (pasted below) when building, even after I've replaced the Macros file with the one that was uploaded on this thread.  I am also using CESM1.0.6.  Help would be appreciated.Another question I had was if I wanted to do an AMIP4K simulation, would I put my modified SST file with 4K added to the SSTs in the SourceMods and run from there using the same F_AMIP_CAM5 configuration?  Thanks,Ivy /glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/control/pspect.F90(10): error #6772: A PARAMETER must not be defined in terms of itself.   [PTRM]   integer, parameter :: ptrm = PTRM                ! M truncation parameter--------------------------------^/glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/control/pspect.F90(11): error #6772: A PARAMETER must not be defined in terms of itself.   [PTRN]   integer, parameter :: ptrn = PTRN                ! N truncation parameter--------------------------------^/glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/control/pspect.F90(12): error #6772: A PARAMETER must not be defined in terms of itself.   [PTRK]   integer, parameter :: ptrk = PTRK                ! K truncation parameter--------------------------------^compilation aborted for /glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/control/pspect.F90 (code 1)gmake: *** [pspect.o] Error 1gmake: *** Waiting for unfinished jobs..../glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/physics/cam/ppgrid.F90(31): error #6772: A PARAMETER must not be defined in terms of itself.   [PCOLS]   parameter (pcols  = PCOLS)-----------------------^/glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/physics/cam/ppgrid.F90(32): error #6592: This symbol must be a defined parameter, an enumerator, or an argument of an inquiry function that evaluates to a compile-time constant.   [PLEV]   parameter (pver   = PLEV)-----------------------^/glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/physics/cam/ppgrid.F90(32): error #6404: This name does not have a type, and must have an explicit type.   [PLEV]   parameter (pver   = PLEV)-----------------------^compilation aborted for /glade/p/cesm/releases/cesm1_0_6/models/atm/cam/src/physics/cam/ppgrid.F90 (code 1) gmake: *** [ppgrid.o] Error 1
 
I don't know anything about the problem you're having with the build, but changing to +4K only requires changing one variable in env_conf.xml. I don't believe it matters where the new SST file is located as long as the path is accessible. Following are the lines I used for setting up some +4K runs a while back (in tcsh):# Set new sst file
set sstfile = "/glade/p/work/woelfle/sstfiles/sst_HadOIBl4k_bc_1.9x2.5_1850_2012_c140320.nc"# Change run script to use new sst file
./xmlchange -file env_conf.xml -id DOCN_SSTDATA_FILENAME -val "${sstfile}" 
 
Top