From 102ca6a2bf4af6fe5bce40f826d16ae436193f5d Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Thu, 15 Jun 2023 13:31:46 -0500 Subject: [PATCH 01/14] setting up a build for musica --- Dockerfile | 2 +- Externals_CAM.cfg | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 23cbc1ea..30f7fe93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -81,7 +81,7 @@ WORKDIR $CASE_NAME RUN ./case.setup -RUN ./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites held_suarez_1994" +RUN ./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites musica" RUN ./xmlchange ROF_NCPL=48 RUN ./xmlchange STOP_OPTION=nsteps RUN ./xmlchange STOP_N=5 diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 32b3fe54..e7052cba 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -22,8 +22,8 @@ required = False [ncar-physics] local_path = src/physics/ncar_ccpp protocol = git -repo_url = https://github.com/NCAR/atmospheric_physics -tag = atmos_phys0_00_018 +repo_url = https://github.com/K20shores/atmospheric_physics +branch = musica_ccpp required = True [silhs] From e932cf6d4ef44e515f346a663578d400bffbc6a7 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Wed, 12 Jul 2023 15:35:54 -0500 Subject: [PATCH 02/14] it ran --- Dockerfile | 35 ++++++++++++++++++++++++++++++++ Externals.cfg | 2 +- cime_config/config_component.xml | 12 +++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 30f7fe93..00e36753 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,41 @@ RUN cd pnetcdf-1.12.3 && \ make -j 8 install && \ ldconfig +ENV FC=gfortran + +################################################### +## Build and install json-fortran +################################################### +RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz \ + && tar -zxvf 8.2.0.tar.gz \ + && cd json-fortran-8.2.0 \ + && mkdir build \ + && cd build \ + && cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \ + && make install -j 8 + +################################################### +## Build and install MUSICA +################################################### + +RUN echo "asdf" + +RUN git clone https://github.com/NCAR/musica.git +RUN mkdir /musica/build \ + && cd /musica/build \ + && export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-8.2.0" \ + && cmake \ + -D ENABLE_TESTS=OFF \ + -D ENABLE_TUVX=OFF \ + .. \ + && make install -j 8 + +################################################### +## Add symlinks +################################################### +RUN ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.a /usr/local/lib/libjsonfortran.a +RUN ln -s /usr/local/musica-0.3.0/lib64/libmusica.a /usr/local/lib/libmusica.a + ################################################### ## Build CAM-SIMA ################################################### diff --git a/Externals.cfg b/Externals.cfg index 2d8ae276..a77f6fa2 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -21,7 +21,7 @@ externals = Externals.cfg required = True [cmeps] -tag = cmeps0.14.24 +tag = cmeps0.14.34 protocol = git repo_url = https://github.com/ESCOMP/CMEPS.git local_path = components/cmeps diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 9a5831f3..0132fa72 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -301,6 +301,18 @@ User mods to apply to specific compset matches. + + char + + -lmusica -ljsonfortran + build_component_cam + env_build.xml + + CAMSIMA linked libraries. The libraries are built by CAMSIMA's buildlib script and should be included + during linking of the model executable. + + + ========================================= CAM naming conventions From a221ab5171740a9806fb42a5e82c8bb1d8d932ae Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Wed, 12 Jul 2023 16:10:49 -0500 Subject: [PATCH 03/14] it ran --- Dockerfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 00e36753..473d3082 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,12 +58,13 @@ RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/8.2.0.tar.gz && cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \ && make install -j 8 +# add a symlink +RUN ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.a /usr/local/lib/libjsonfortran.a + ################################################### ## Build and install MUSICA ################################################### -RUN echo "asdf" - RUN git clone https://github.com/NCAR/musica.git RUN mkdir /musica/build \ && cd /musica/build \ @@ -74,10 +75,7 @@ RUN mkdir /musica/build \ .. \ && make install -j 8 -################################################### -## Add symlinks -################################################### -RUN ln -s /usr/local/jsonfortran-gnu-8.2.0/lib/libjsonfortran.a /usr/local/lib/libjsonfortran.a +# add a symlink RUN ln -s /usr/local/musica-0.3.0/lib64/libmusica.a /usr/local/lib/libmusica.a ################################################### From 030e0deae950a5f4e01045d41be6e9fc088013ce Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Thu, 13 Jul 2023 09:20:53 -0600 Subject: [PATCH 04/14] Have linting Github Action skip any files that it cannot decode using UTF-8. --- .github/scripts/pr_mod_file_tests.py | 53 ++++++++++++++++++---------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/.github/scripts/pr_mod_file_tests.py b/.github/scripts/pr_mod_file_tests.py index 752dfa73..129a42a5 100755 --- a/.github/scripts/pr_mod_file_tests.py +++ b/.github/scripts/pr_mod_file_tests.py @@ -59,28 +59,45 @@ def _file_is_python(filename): is_python = True else: #If no ".py" extension exists, then - #open the file and look for a shabang - #that contains the word "python". - with open(filename, "r", encoding='utf-8') as mod_file: - #Loop over lines in file: - for line in mod_file: - - #Ignore blank lines: - if line.strip(): - - #Check that first non-blank - #line is a shabang: - if line[0:2] == '#!': - #If so, then check that the word - #"python" is also present: - if line.find("python") != -1: - #If the word exists, then assume - #it is a python file: - is_python = True + #try to open the file and look for + #a shabang that contains the word "python". + try: + with open(filename, "r", encoding='utf-8') as mod_file: + #Loop over lines in file: + for line in mod_file: + + #Ignore blank lines: + if line.strip(): + + #Check that first non-blank + #line is a shabang: + if line[0:2] == '#!': + #If so, then check that the word + #"python" is also present: + if line.find("python") != -1: + #If the word exists, then assume + #it is a python file: + is_python = True + #End if + #End if + #End if #Exit loop, as only the first non-blank #line should be examined: break + #End for + #End with + except UnicodeDecodeError: + #Binary files, which we do not care about here, + #can result in a decode error, so if that error + #is raised just skip the file with a message stating + #that it is being skipped (just in case): + wmsg = f"WARNING: The file '{filename}' cannot currently be opened,\n" + wmsg += "so skipping any attempt at analysing." + print(wmsg) + #End except + #End if + #End if #Return file type result: return is_python From 7418184b528ba841c65c33c1992da33c1c6f0a84 Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Thu, 13 Jul 2023 09:34:14 -0600 Subject: [PATCH 05/14] Update pylintrc file to remove deprecation warning. --- test/.pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/.pylintrc b/test/.pylintrc index 53c651b9..18501932 100644 --- a/test/.pylintrc +++ b/test/.pylintrc @@ -457,4 +457,4 @@ known-third-party=enchant # Exceptions that will emit a warning when being caught. Defaults to # "Exception" -overgeneral-exceptions=Exception +overgeneral-exceptions=builtins.Exception From c18dc15e76f975e448ce1d27943ee0415cd6296c Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Fri, 21 Jul 2023 15:40:08 -0500 Subject: [PATCH 06/14] Update .dockerignore better language --- .dockerignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 14681298..267cdb79 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,7 @@ -# blacklist all +# ignore all * -# whitelist things to copy +# include things to copy !Externals* !src/ !cime_config/ From 40ff604391a6f8f7c2ced0698e6134ce877737a6 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 24 Jul 2023 09:47:01 -0500 Subject: [PATCH 07/14] Update Externals_CAM.cfg Co-authored-by: Jesse Nusbaumer --- Externals_CAM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index e7052cba..6a7214af 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -22,8 +22,8 @@ required = False [ncar-physics] local_path = src/physics/ncar_ccpp protocol = git -repo_url = https://github.com/K20shores/atmospheric_physics -branch = musica_ccpp +repo_url = https://github.com/NCAR/atmospheric_physics +tag = atmos_phys0_00_019 required = True [silhs] From 05a1018ed9b3e16cf46b3a9244153a6101913de9 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Wed, 26 Jul 2023 16:23:13 -0500 Subject: [PATCH 08/14] updating tag --- Externals_CAM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 6a7214af..3e8da924 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -23,7 +23,7 @@ required = False local_path = src/physics/ncar_ccpp protocol = git repo_url = https://github.com/NCAR/atmospheric_physics -tag = atmos_phys0_00_019 +tag = atmos_phys0_00_020 required = True [silhs] From 13ee5df7c8a0f23f26fa23814bdc54087f6dc9b7 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 7 Aug 2023 10:12:38 -0500 Subject: [PATCH 09/14] updating readme, dupcliating dockerfile to have a base build with held suarez --- README.md | 40 ++++++++---- docker/Dockerfile | 85 ++++++++++++++++++++++++++ Dockerfile => docker/Dockerfile.musica | 0 3 files changed, 114 insertions(+), 11 deletions(-) create mode 100644 docker/Dockerfile rename Dockerfile => docker/Dockerfile.musica (100%) diff --git a/README.md b/README.md index 2a9d029e..e1c12b1e 100644 --- a/README.md +++ b/README.md @@ -22,33 +22,34 @@ git checkout development Good luck, and have a great day! ## Docker - If you don't want to worry about installing our dependencies, -you can create a build of CAM-SIMA using docker. To do so, you will need to -download and install [docker desktop](https://docs.docker.com/desktop/). +you can create a build of CAM-SIMA using docker. + +### Download docker +Download and install [docker desktop](https://docs.docker.com/desktop/). #### Windows Follow the installation instructions for Windows [here](https://docs.docker.com/desktop/install/windows-install/) - #### Linux Follow the installation instructions for Linux [here](https://docs.docker.com/desktop/install/linux-install/) #### MacOS Follow the installation instructions for Mac [here](https://docs.docker.com/desktop/install/mac-install/) -### Download docker -### Build the docker file -1. First, build the esmf docker image. You must tag the build with `esmf` +### Build the base docker file +1. First, build the esmf docker image. You must tag the build with `esmf`. This will take quite some time. ``` -cd docker -docker build -f Dockerfile.esmf -t esmf . +docker build -f docker/Dockerfile.esmf -t esmf . ``` -2. Build the CAM-SIMA image + +### CAM-SIMA + +1. Build the CAM-SIMA image ``` cd ../ -docker build -t cam-sima . +docker build -f docker/Dockerfile -t cam-sima . ``` 3. Run the image ``` @@ -57,4 +58,21 @@ docker run --rm -it cam-sima 4. Submit the case ``` ./case.submit +``` + +### MUSICA +You can include musica chemistry by using the correct docker file + +1. Build the MUSICA image +``` +cd ../ +docker build -f docker/Dockerfile.musica -t musica . +``` +3. Run the image +``` +docker run --rm -it musica +``` +4. Submit the case +``` +./case.submit ``` \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..1d6acc6c --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,85 @@ +# parts of CAM require x86 architecture (gptl, which relies on the rdtsc x86 assembly instruction) +# esmf is am image you are expected to have built. Read the README file for instructions +FROM esmf:latest + +################################################### +## Install necessary packages +################################################### +RUN dnf -y update \ + && dnf -y install \ + ftp \ + git \ + hostname \ + m4 \ + python \ + sudo \ + svn \ + tree \ + vim \ + && dnf clean all + +################################################### +## Make sure the mpi compilers can be found +################################################### +ENV PATH="${PATH}:/usr/lib64/mpich/bin/" +ENV OMP_NUM_THREADS=5 + +################################################### +## Build and install Parallel-netcdf +################################################### +RUN wget -q https://parallel-netcdf.github.io/Release/pnetcdf-1.12.3.tar.gz +RUN tar zxf pnetcdf-1.12.3.tar.gz +RUN cd pnetcdf-1.12.3 && \ + ./configure --prefix=/usr/local && \ + make -j 8 install && \ + ldconfig + +################################################### +## Build CAM-SIMA +################################################### + +# create a user to run the case +RUN adduser cam_sima_user \ + && echo "cam_sima_user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/cam_sima_user \ + && chmod 0440 /etc/sudoers.d/cam_sima_user + +# copy in the CAM-SIMA code and give the proper user permissions +COPY --chown=cam_sima_user . /home/cam_sima_user/CAM-SIMA + +USER cam_sima_user +WORKDIR /home/cam_sima_user/CAM-SIMA + +# pull the dependencies +RUN ./manage_externals/checkout_externals + +# Copy in the machine information for the container +RUN cp /home/cam_sima_user/CAM-SIMA/docker/config_machines.xml /home/cam_sima_user/CAM-SIMA/ccs_config/machines/ + +# Set environment variables needed to create and build the case +ENV USER=$(whoami) +ENV CASE_NAME=/home/cam_sima_user/case_name +ENV CESMDATAROOT=/home/cam_sima_user/cesm_data +ENV CIME_MACHINE=container +ENV CIME_MODEL=cesm +ENV ESMFMKFILE=/usr/local/lib/esmf.mk + +# Create a case +RUN ./cime/scripts/create_newcase --case $CASE_NAME --compset FPHYStest --res ne5_ne5_mg37 --run-unsupported + +WORKDIR $CASE_NAME + +RUN ./case.setup + +RUN ./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites held_suarez_1994" +RUN ./xmlchange ROF_NCPL=48 +RUN ./xmlchange STOP_OPTION=nsteps +RUN ./xmlchange STOP_N=5 + +# Copy in the grid files and a snapshot file +RUN chmod +x /home/cam_sima_user/CAM-SIMA/docker/ftp_download.sh +RUN /home/cam_sima_user/CAM-SIMA/docker/ftp_download.sh + +# # add the snapshot file +RUN echo "ncdata='/home/cam_sima_user/run_heldsuarez_cam6_nt2_bigg_try005.cam.h5.0001-01-01-00000.nc'" >> user_nl_cam + +RUN ./case.build \ No newline at end of file diff --git a/Dockerfile b/docker/Dockerfile.musica similarity index 100% rename from Dockerfile rename to docker/Dockerfile.musica From 3f0906b14eb242704a3ead7366a7580944f300d8 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 7 Aug 2023 10:16:29 -0500 Subject: [PATCH 10/14] correcting readme --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index e1c12b1e..35b3bcbb 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,6 @@ docker build -f docker/Dockerfile.esmf -t esmf . 1. Build the CAM-SIMA image ``` -cd ../ docker build -f docker/Dockerfile -t cam-sima . ``` 3. Run the image @@ -65,7 +64,6 @@ You can include musica chemistry by using the correct docker file 1. Build the MUSICA image ``` -cd ../ docker build -f docker/Dockerfile.musica -t musica . ``` 3. Run the image From 983f3f36e423a80580dbd4f23ee70559406e02c3 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 7 Aug 2023 10:51:42 -0500 Subject: [PATCH 11/14] correcting small issue, both cam sima and musica built and ran successfully --- cime_config/config_component.xml | 12 -- docker/Dockerfile.musica | 1 + docker/config_component.xml.musica | 322 +++++++++++++++++++++++++++++ 3 files changed, 323 insertions(+), 12 deletions(-) create mode 100644 docker/config_component.xml.musica diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 0132fa72..9a5831f3 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -301,18 +301,6 @@ User mods to apply to specific compset matches. - - char - - -lmusica -ljsonfortran - build_component_cam - env_build.xml - - CAMSIMA linked libraries. The libraries are built by CAMSIMA's buildlib script and should be included - during linking of the model executable. - - - ========================================= CAM naming conventions diff --git a/docker/Dockerfile.musica b/docker/Dockerfile.musica index b8dd81de..a972e5ac 100644 --- a/docker/Dockerfile.musica +++ b/docker/Dockerfile.musica @@ -81,6 +81,7 @@ COPY --chown=cam_sima_user . /home/cam_sima_user/CAM-SIMA USER cam_sima_user WORKDIR /home/cam_sima_user/CAM-SIMA +RUN cp docker/config_component.xml.musica cime_config/config_component.xml # pull the dependencies RUN ./manage_externals/checkout_externals diff --git a/docker/config_component.xml.musica b/docker/config_component.xml.musica new file mode 100644 index 00000000..0132fa72 --- /dev/null +++ b/docker/config_component.xml.musica @@ -0,0 +1,322 @@ + + + + + + + CAM cam6 physics: + CAM cam5 physics: + CAM cam4 physics: + CAM simplified and non-versioned physics: + + + abrupt quadrupling of CO2 with other forcings maintained at 1850 piControl levels (CMIP6 DECK abrupt4xCO2 experiment) : + ramped CO2 increasing by 1% per year with other forcings maintained at 1850 piControl levels (CMIP6 DECK 1pctCO2 experiment) : + + + CAM stand-alone single column mode -- need to define usermods directory with IOP settings: + CAM winds and temperature nudged towards prescribed meteorology: + + CAM-Chem troposphere/stratosphere chem with simplified volatility basis set SOA scheme and modal aersols : + CAM-Chem troposphere/stratosphere chem with simplified volatility basis set SOA scheme and fire emissons : + CAM CLUBB - turned on by default in CAM60: + CAM-Chem troposphere/stratosphere chem with extended volatility basis set SOA scheme and modal aersols : + CAM CO2 ramp: + CAM super-parameterized CAM one moment SAM microphysics + CAM super-parameterized CAM one moment SAM microphysics using CLUBB + CAM super-parameterized CAM double moment m2005 SAM microphysics + CAM super-parameterized CAM double moment m2005 SAM microphysics using CLUBB + CAM tropospheric chemistry with bulk aerosols: + + + WACCM with middle atmosphere chemistry: + WACCM with middle atmosphere chemistry with enhanced D-region ion chemistry: + WACCM-X enhanced ionosphere, transport, and electrodynamics: + WACCM-X enhanced ionosphere, transport, and electrodynamics with D-region ion chemistry: + WACCM specified chemistry: + WACCM with tropospheric, stratospheric, mesospheric, and lower thermospheric chemistry: + + + CAM dry adiabatic configurarion (no physics forcing): + CAM dry adiabatic baroclinic instability (Polvani et al., 2004): + CAM moist Held-Suarez forcing (Thatcher and Jablonowski, 2016): + CAM dry Held-Suarez forcing (Held and Suarez (1994)): + CAM moist dynamical core test with Ullrich et al. (2014) baroclinic wave IC, Kessler physics and terminator chemistry: + + + CAM Parallel Offline Radiation Tool: + + + CAM Physics Testbed (no dynamical core): + + + + + char + cam + cam + case_comp + env_case.xml + Name of atmospheric component + + + + char + + UNSET + build_component_cam + env_build.xml + CAM cpp definitions (setup automatically - DO NOT EDIT) + + + + char + eul,fv,se,none + fv + + eul + se + + build_component_cam + env_build.xml + CAM dynamical core + + + + char + + + + + + + + + + + + + + + --physics-suites kessler --analytic_ic + --physics-suites held_suarez_1994 --analytic_ic + --dyn none --physics-suites adiabatic + + + + + + + + build_component_cam + env_build.xml + + CAM configure options, see CAM configure utility for details + Provides option(s) for the CAM configure utility. + CAM_CONFIG_OPTS are normally set as compset variables (e.g., -phys cam4 -chem waccm_ma) + and in general should not be modified for supported compsets. It is recommended that if you want + to modify this value for your experiment, you should use your own user-defined + component sets via using create_newcase with a compset_file argument + + + + + char + + UNSET + + 1850_cam4 + 1850_cam5 + + 1850_cam6 + waccm_tsmlt_1850_cam6 + waccm_ma_1850_cam6 + waccm_sc_1850_cam6 + + 2000_cam4_trop_chem + waccmxie_ma_2000_cam4 + + 2000_cam6 + waccm_tsmlt_2000_cam6 + waccm_ma_2000_cam6 + waccm_sc_2000_cam6 + 2000_trop_strat_vbs_cam6 + waccmx_ma_2000_cam6 + + aquaplanet_cam4 + aquaplanet_cam4 + aquaplanet_cam5 + aquaplanet_cam5 + aquaplanet_cam6 + aquaplanet_cam6 + + 2010_cam6 + 2010_trop_strat_vbs_cam6 + waccm_tsmlt_2010_cam6 + waccm_sc_2010_cam6 + + 1850-2005_cam5 + 1850-2005_cam4 + + 1850-2005_cam4 + 1850-2005_cam4_bgc + 1950-2010_ccmi_refc1_waccmx_ma + 1850-2005_cam5 + hist_cam6 + waccm_tsmlt_hist_cam6 + waccm_sc_hist_cam6 + waccm_ma_hist_cam6 + waccm_ma_hist_cam6 + waccm_ma_hist_cam4 + hist_trop_strat_vbs_cam6 + hist_trop_strat_vbsext_cam6 + hist_trop_strat_vbsfire_cam6 + waccmx_ma_hist_cam6 + + 1850-PD_cam5 + + 2005-2100_cam4_rcp26 + 2005-2100_cam4_rcp45 + 2005-2100_cam4_rcp45_bgc + 2005-2100_cam4_rcp60 + 2005-2100_cam4_rcp85 + 2005-2100_cam4_rcp85_bgc + + 2006-2100_cam5_rcp26 + 2006-2100_cam5_rcp45 + 2006-2100_cam5_rcp60 + 2006-2100_cam5_rcp85 + + sd_waccmx_ma_cam4 + sd_waccmx_ma_cam4 + sd_waccmx_ma_cam6 + sd_waccm_tsmlt_cam6 + sd_waccm_ma_cam6 + sd_waccm_ma_cam6 + sd_waccm_ma_cam4 + sd_trop_strat_vbs_cam6 + sd_cam6 + + dabi_p2004 + held_suarez_1994 + dctest_tj2016 + dctest_baro_kessler + + + scam_arm97 + + run_component_cam + env_run.xml + CAM namelist use_case. Provides the use_case option for the + CAM build-namelist utility (which is called from + $CASEROOT/Buildconf/cam.buildnml). The CAM build-namelist + leverages groups of namelist options (use cases) that are often + paired with the CAM configure options. These use cases are xml + files located in + $CIMEROOT/../components/atm/cam/bld/namelist_files/use_cases. + In general, this variable should not be modified for supported + component sets (compsets). Recommendation: If you want to + modify this value for your experiment, use your own user-defined + component sets. + + + + char + + + + $SRCROOT/components/cam/cime_config/usermods_dirs/aquap + $SRCROOT/components/cam/cime_config/usermods_dirs/aquap + $SRCROOT/components/cam/cime_config/usermods_dirs/scam_mandatory + + run_component_cam + env_case.xml + User mods to apply to specific compset matches. + + + + char + + -lmusica -ljsonfortran + build_component_cam + env_build.xml + + CAMSIMA linked libraries. The libraries are built by CAMSIMA's buildlib script and should be included + during linking of the model executable. + + + + + ========================================= + CAM naming conventions + ========================================= + + + From 22a08324e83b02f184afc123c7578ceb21cee297 Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Thu, 10 Aug 2023 13:43:38 -0600 Subject: [PATCH 12/14] Bring musica link settings into main config_component.xml file. --- .github/scripts/pr_mod_file_tests.py | 8 +- cime_config/config_component.xml | 17 ++ docker/Dockerfile.musica | 2 +- docker/config_component.xml.musica | 322 --------------------------- 4 files changed, 22 insertions(+), 327 deletions(-) delete mode 100644 docker/config_component.xml.musica diff --git a/.github/scripts/pr_mod_file_tests.py b/.github/scripts/pr_mod_file_tests.py index 129a42a5..ac166e70 100755 --- a/.github/scripts/pr_mod_file_tests.py +++ b/.github/scripts/pr_mod_file_tests.py @@ -80,11 +80,11 @@ def _file_is_python(filename): is_python = True #End if #End if - #End if - #Exit loop, as only the first non-blank - #line should be examined: - break + #Exit loop, as only the first non-blank + #line should be examined: + break + #End if #End for #End with except UnicodeDecodeError: diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 9a5831f3..d48558a2 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -301,6 +301,23 @@ User mods to apply to specific compset matches. + + char + + -lmusica -ljsonfortran + + + + + build_component_cam + env_build.xml + + CAM-SIMA linked libraries. The libraries are built by + CAM-SIMA's buildlib script and should be included + during linking of the model executable. + + + ========================================= CAM naming conventions diff --git a/docker/Dockerfile.musica b/docker/Dockerfile.musica index a972e5ac..b02cf7b6 100644 --- a/docker/Dockerfile.musica +++ b/docker/Dockerfile.musica @@ -81,7 +81,6 @@ COPY --chown=cam_sima_user . /home/cam_sima_user/CAM-SIMA USER cam_sima_user WORKDIR /home/cam_sima_user/CAM-SIMA -RUN cp docker/config_component.xml.musica cime_config/config_component.xml # pull the dependencies RUN ./manage_externals/checkout_externals @@ -105,6 +104,7 @@ WORKDIR $CASE_NAME RUN ./case.setup RUN ./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites musica" +RUN ./xmlchange CAM_LINKED_LIBS="-lmusica -ljsonfortran" RUN ./xmlchange ROF_NCPL=48 RUN ./xmlchange STOP_OPTION=nsteps RUN ./xmlchange STOP_N=5 diff --git a/docker/config_component.xml.musica b/docker/config_component.xml.musica deleted file mode 100644 index 0132fa72..00000000 --- a/docker/config_component.xml.musica +++ /dev/null @@ -1,322 +0,0 @@ - - - - - - - CAM cam6 physics: - CAM cam5 physics: - CAM cam4 physics: - CAM simplified and non-versioned physics: - - - abrupt quadrupling of CO2 with other forcings maintained at 1850 piControl levels (CMIP6 DECK abrupt4xCO2 experiment) : - ramped CO2 increasing by 1% per year with other forcings maintained at 1850 piControl levels (CMIP6 DECK 1pctCO2 experiment) : - - - CAM stand-alone single column mode -- need to define usermods directory with IOP settings: - CAM winds and temperature nudged towards prescribed meteorology: - - CAM-Chem troposphere/stratosphere chem with simplified volatility basis set SOA scheme and modal aersols : - CAM-Chem troposphere/stratosphere chem with simplified volatility basis set SOA scheme and fire emissons : - CAM CLUBB - turned on by default in CAM60: - CAM-Chem troposphere/stratosphere chem with extended volatility basis set SOA scheme and modal aersols : - CAM CO2 ramp: - CAM super-parameterized CAM one moment SAM microphysics - CAM super-parameterized CAM one moment SAM microphysics using CLUBB - CAM super-parameterized CAM double moment m2005 SAM microphysics - CAM super-parameterized CAM double moment m2005 SAM microphysics using CLUBB - CAM tropospheric chemistry with bulk aerosols: - - - WACCM with middle atmosphere chemistry: - WACCM with middle atmosphere chemistry with enhanced D-region ion chemistry: - WACCM-X enhanced ionosphere, transport, and electrodynamics: - WACCM-X enhanced ionosphere, transport, and electrodynamics with D-region ion chemistry: - WACCM specified chemistry: - WACCM with tropospheric, stratospheric, mesospheric, and lower thermospheric chemistry: - - - CAM dry adiabatic configurarion (no physics forcing): - CAM dry adiabatic baroclinic instability (Polvani et al., 2004): - CAM moist Held-Suarez forcing (Thatcher and Jablonowski, 2016): - CAM dry Held-Suarez forcing (Held and Suarez (1994)): - CAM moist dynamical core test with Ullrich et al. (2014) baroclinic wave IC, Kessler physics and terminator chemistry: - - - CAM Parallel Offline Radiation Tool: - - - CAM Physics Testbed (no dynamical core): - - - - - char - cam - cam - case_comp - env_case.xml - Name of atmospheric component - - - - char - - UNSET - build_component_cam - env_build.xml - CAM cpp definitions (setup automatically - DO NOT EDIT) - - - - char - eul,fv,se,none - fv - - eul - se - - build_component_cam - env_build.xml - CAM dynamical core - - - - char - - - - - - - - - - - - - - - --physics-suites kessler --analytic_ic - --physics-suites held_suarez_1994 --analytic_ic - --dyn none --physics-suites adiabatic - - - - - - - - build_component_cam - env_build.xml - - CAM configure options, see CAM configure utility for details - Provides option(s) for the CAM configure utility. - CAM_CONFIG_OPTS are normally set as compset variables (e.g., -phys cam4 -chem waccm_ma) - and in general should not be modified for supported compsets. It is recommended that if you want - to modify this value for your experiment, you should use your own user-defined - component sets via using create_newcase with a compset_file argument - - - - - char - - UNSET - - 1850_cam4 - 1850_cam5 - - 1850_cam6 - waccm_tsmlt_1850_cam6 - waccm_ma_1850_cam6 - waccm_sc_1850_cam6 - - 2000_cam4_trop_chem - waccmxie_ma_2000_cam4 - - 2000_cam6 - waccm_tsmlt_2000_cam6 - waccm_ma_2000_cam6 - waccm_sc_2000_cam6 - 2000_trop_strat_vbs_cam6 - waccmx_ma_2000_cam6 - - aquaplanet_cam4 - aquaplanet_cam4 - aquaplanet_cam5 - aquaplanet_cam5 - aquaplanet_cam6 - aquaplanet_cam6 - - 2010_cam6 - 2010_trop_strat_vbs_cam6 - waccm_tsmlt_2010_cam6 - waccm_sc_2010_cam6 - - 1850-2005_cam5 - 1850-2005_cam4 - - 1850-2005_cam4 - 1850-2005_cam4_bgc - 1950-2010_ccmi_refc1_waccmx_ma - 1850-2005_cam5 - hist_cam6 - waccm_tsmlt_hist_cam6 - waccm_sc_hist_cam6 - waccm_ma_hist_cam6 - waccm_ma_hist_cam6 - waccm_ma_hist_cam4 - hist_trop_strat_vbs_cam6 - hist_trop_strat_vbsext_cam6 - hist_trop_strat_vbsfire_cam6 - waccmx_ma_hist_cam6 - - 1850-PD_cam5 - - 2005-2100_cam4_rcp26 - 2005-2100_cam4_rcp45 - 2005-2100_cam4_rcp45_bgc - 2005-2100_cam4_rcp60 - 2005-2100_cam4_rcp85 - 2005-2100_cam4_rcp85_bgc - - 2006-2100_cam5_rcp26 - 2006-2100_cam5_rcp45 - 2006-2100_cam5_rcp60 - 2006-2100_cam5_rcp85 - - sd_waccmx_ma_cam4 - sd_waccmx_ma_cam4 - sd_waccmx_ma_cam6 - sd_waccm_tsmlt_cam6 - sd_waccm_ma_cam6 - sd_waccm_ma_cam6 - sd_waccm_ma_cam4 - sd_trop_strat_vbs_cam6 - sd_cam6 - - dabi_p2004 - held_suarez_1994 - dctest_tj2016 - dctest_baro_kessler - - - scam_arm97 - - run_component_cam - env_run.xml - CAM namelist use_case. Provides the use_case option for the - CAM build-namelist utility (which is called from - $CASEROOT/Buildconf/cam.buildnml). The CAM build-namelist - leverages groups of namelist options (use cases) that are often - paired with the CAM configure options. These use cases are xml - files located in - $CIMEROOT/../components/atm/cam/bld/namelist_files/use_cases. - In general, this variable should not be modified for supported - component sets (compsets). Recommendation: If you want to - modify this value for your experiment, use your own user-defined - component sets. - - - - char - - - - $SRCROOT/components/cam/cime_config/usermods_dirs/aquap - $SRCROOT/components/cam/cime_config/usermods_dirs/aquap - $SRCROOT/components/cam/cime_config/usermods_dirs/scam_mandatory - - run_component_cam - env_case.xml - User mods to apply to specific compset matches. - - - - char - - -lmusica -ljsonfortran - build_component_cam - env_build.xml - - CAMSIMA linked libraries. The libraries are built by CAMSIMA's buildlib script and should be included - during linking of the model executable. - - - - - ========================================= - CAM naming conventions - ========================================= - - - From 3e0b39e3aa2340b450b859cf5f638f92485beb72 Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Thu, 10 Aug 2023 14:37:47 -0600 Subject: [PATCH 13/14] Update shebang calls to explicitly reference python3. --- .github/scripts/branch_pr_issue_closer.py | 2 +- .github/scripts/pr_mod_file_tests.py | 2 +- .github/scripts/pylint_threshold_test.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/branch_pr_issue_closer.py b/.github/scripts/branch_pr_issue_closer.py index 48a4b05d..1ad48ebe 100755 --- a/.github/scripts/branch_pr_issue_closer.py +++ b/.github/scripts/branch_pr_issue_closer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Script name: branch_PR_issue_closer.py diff --git a/.github/scripts/pr_mod_file_tests.py b/.github/scripts/pr_mod_file_tests.py index ac166e70..e177c563 100755 --- a/.github/scripts/pr_mod_file_tests.py +++ b/.github/scripts/pr_mod_file_tests.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Script name: pr_mod_file_tests.py diff --git a/.github/scripts/pylint_threshold_test.py b/.github/scripts/pylint_threshold_test.py index e00163dc..f6c92830 100755 --- a/.github/scripts/pylint_threshold_test.py +++ b/.github/scripts/pylint_threshold_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Modle name: pylint_threshold_test.py From c8e8e80506fff95374515966194b2c5311e2a65f Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Thu, 10 Aug 2023 15:08:14 -0600 Subject: [PATCH 14/14] Update pr_mod_file script to be more pythonic. --- .github/scripts/pr_mod_file_tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/pr_mod_file_tests.py b/.github/scripts/pr_mod_file_tests.py index e177c563..02021a26 100755 --- a/.github/scripts/pr_mod_file_tests.py +++ b/.github/scripts/pr_mod_file_tests.py @@ -71,10 +71,10 @@ def _file_is_python(filename): #Check that first non-blank #line is a shabang: - if line[0:2] == '#!': + if line.startswith("#!"): #If so, then check that the word #"python" is also present: - if line.find("python") != -1: + if "python" in line: #If the word exists, then assume #it is a python file: is_python = True