diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cdab3f7c2b..d2bad8dc11 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,8 +8,16 @@ See the below examples for more information. https://github.com/MPAS-Dev/MPAS/pull/930 https://github.com/MPAS-Dev/MPAS/pull/931 +### Mandatory Questions + +* Does this PR include any additions or changes to external inputs (e.g., microphysics lookup tables, static data for gravity-wave drag -- things like that)? + - yes or no +* Does this PR require updating one or more baselines for the CI tests? If so, what? + - yes or no; if yes, provide more details + ### Priority Reviewers * Please list the developers/collaborators you'd like to prioritize for review * Example: - - @clark-evans + - @person1 + - @person2 diff --git a/.github/workflows/bld_mpas_images.yaml b/.github/workflows/bld_mpas_images.yaml new file mode 100644 index 0000000000..75c33ac538 --- /dev/null +++ b/.github/workflows/bld_mpas_images.yaml @@ -0,0 +1,76 @@ +name: MPAS-A Base Images Build +run-name: CI Image Build for MPAS-A + +on: + push: + branches: + # Only build containers when pushing to gsl/develop + - "gsl/develop" + +jobs: + docker: + #if: github.repository == 'ufs-community/MPAS-Model' + strategy: + fail-fast: false # Disable fail-fast + matrix: + toolchain: [gnu,oneapi]#,nvhpc] + include: + # Set toolchain configuration(s) + - toolchain: gnu + nfversion: 4.6.2 + pnfversion: 1.14.1 + - toolchain: oneapi + nfversion: 4.5.4 + pnfversion: 1.12.3 +# - toolchain: nvhpc +# nfversion: 4.5.4 +# pnfversion: 1.12.3 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Log in to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Build minimal-toolchain:${{ matrix.toolchain }} + uses: docker/build-push-action@v6 + with: + file: docker/Dockerfile-${{ matrix.toolchain }}-minimal + tags: minimal-toolchain:${{ matrix.toolchain }} + + - name: Build add-netcdf:${{ matrix.toolchain }} + uses: docker/build-push-action@v6 + with: + file: docker/Dockerfile-add-netcdf + tags: add-netcdf:${{ matrix.toolchain }} + build-args: | + TOOLCHAIN=${{ matrix.toolchain }} + NFVERSION=${{ matrix.nfversion }} + + - name: Build add-pnetcdf:${{ matrix.toolchain }} + uses: docker/build-push-action@v6 + with: + file: docker/Dockerfile-add-pnetcdf + tags: add-pnetcdf:${{ matrix.toolchain }} + build-args: | + TOOLCHAIN=${{ matrix.toolchain }} + PNFVERSION=${{ matrix.pnfversion }} + + - name: Build add-python:${{ matrix.toolchain }} + uses: docker/build-push-action@v6 + with: + file: docker/Dockerfile-add-python + build-args: TOOLCHAIN=${{ matrix.toolchain }} + tags: add-python:${{ matrix.toolchain }} + + - name: Build and push dustinswales/ufs-community-mpas-ci:${{ matrix.toolchain }} + uses: docker/build-push-action@v6 + with: + file: docker/Dockerfile-finalize + build-args: TOOLCHAIN=${{ matrix.toolchain }} + push: True + tags: | + dustinswales/ufs-community-mpas-ci:${{ matrix.toolchain }} diff --git a/.github/workflows/run_mpas.yml b/.github/workflows/run_mpas.yml index 2e998264fb..f4e911f4d8 100644 --- a/.github/workflows/run_mpas.yml +++ b/.github/workflows/run_mpas.yml @@ -5,18 +5,16 @@ on: [push, pull_request, workflow_dispatch] ############################################################################################# # Testing script/workflow for ufs-community fork of MPAS-Dev/MPAS-A. # -# Description (outside of software stack setup (Step 0)) +# Description # # - Clone and build MPAS for baseline generation. # - Clone and build MPAS for feature branch testing (against baselines). -# - Clone ufs-community MPAS testing repository. -# - Fetch data from THREDDS server. -# - Donwload any other data (e.g. MP tables, etc). +# - Download any data (MP tables, MPAS ICs/LBCs/etc...). # - Create/populate MPAS run directories. # - Run MPAS using baseline codebase/configuration. # - Run MPAS using feature branch. # - Compare results. -# - Save output files to GitHub artifact (for comparision w/ inline/standaloen results) +# - Save output files to GitHub artifact (for comparision w/ inline/standalone results) # # Comments: # - The test build/run configurations matrix is described below. @@ -37,21 +35,31 @@ on: [push, pull_request, workflow_dispatch] # ############################################################################################# jobs: - run_mpas: - # + run_mpas: runs-on: ubuntu-22.04 strategy: fail-fast: false # Disable fail-fast matrix: + f-compiler: [gfortran]#,ifx] physics: [mesoscale_reference, convection_permitting, mesoscale_reference_noahmp] repo: [ufs-community, MPAS-Dev] branch: [gsl/develop, v8.3.0] - build-type: [Release, Debug] + build-type: [Debug, Release] exclude: - repo: MPAS-Dev branch: gsl/develop - repo: ufs-community branch: v8.3.0 + include: + # Set container images for each compiler + - f-compiler: gfortran + bld_target: gfortran + image: dustinswales/ufs-community-mpas-ci:gnu +# - f-compiler: ifx +# image: dustinswales/ufs-community-mpas-ci:oneapi +# bld_target: intel + container: + image: ${{ matrix.image }} # defaults: run: @@ -59,149 +67,41 @@ jobs: # Environmental variables env: - fortran-compiler: gfortran-12 - py-version: 3.11 - runner_ROOT: /home/runner - mpas_rt_ROOT: /home/runner/work/MPAS-Model - mpas_bl_ROOT: /home/runner/MPAS-Model-BL - mpas_run_ROOT: /home/runner/work - AUTOCONF_VERSION: 2.71 - AUTOMAKE_VERSION: 1.17 - M4_VERSION: 1.4.19 - LIBTOOL_VERSION: 2.5.4 - PNETCDF: /home/runner/PnetCDF - AUTOTOOLS: /home/runner/AUTOTOOLS - OMPI: /home/runner/ompi-4.1.6 - grid_dir: thredds/catalog/retro/mpas_ci/mpas_test_data/grid - case_dir: retro/mpas_ci/mpas_test_data/run_case_input/create_case_output - mpdata_dir: retro/mpas_ci/mpas_test_data/run_case_input/tables - ic_source: gfs - domain: conus - res: 120km - nproc: 2 - yyyy: "2023" - mm: "03" - dd: "10" - hh: "15" - nml: ncar - case_base: ncar-v8.3.0-intelmpi - code_base: ncar - nml_version: ncar + py-version: 3.11 + runner_ROOT: /__w/ + MPAS_ROOT: /__w/MPAS-Model/MPAS-Model + mpas_bl_ROOT: /__w/MPAS-Model-BL + PNETCDF: /opt/pnetcdf + mpas_ics: testing_and_setup/ufs-community/data/ics/mpasdev.gfs.winter + ic_source: gfs # Workflow steps steps: ########################################################################################## - # Step 0: Build Software Stack needed for MPAS on GitHub server. + # Step 1: Setup ########################################################################################## - - name: Install NetCDF library - run: | - sudo apt-get update - sudo apt-get install libnetcdff-dev - - - name: Cache openmpi - id: cache-openmpi - uses: actions/cache@v4 - with: - path: /home/runner/ompi-4.1.6 - key: cache-openmpi-${{env.fortran-compiler}}-key - - - name: Install openmpi - if: steps.cache-openmpi.outputs.cache-hit != 'true' + - name: Setup MPI (GNU) + if: matrix.f-compiler == 'gfortran' run: | - wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz - tar -xvf v4.1.6.tar.gz - cd ompi-4.1.6 - ./autogen.pl - ./configure --prefix=${OMPI} - make -j4 - make install + echo "CC=mpicc" >> $GITHUB_ENV + echo "CXX=mpicxx" >> $GITHUB_ENV + echo "FC=mpif90" >> $GITHUB_ENV - - name: Add (OMPI) to Paths + - name: Setup MPI (Intel OneAPI) + if: matrix.f-compiler == 'ifx' run: | - echo "LD_LIBRARY_PATH=${OMPI}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - echo "PATH=${OMPI}/bin:$PATH" >> $GITHUB_ENV - - - name: Cache GNU autotools - id: cache-AUTOTOOLS - uses: actions/cache@v4 - with: - path: /home/runner/AUTOTOOLS - key: cache-AUTOTOOLS-${{env.fortran-compiler}}-key - - - name: Build GNU autotools - if: steps.cache-AUTOTOOLS.outputs.cache-hit != 'true' - run: | - wget -q https://ftp.gnu.org/gnu/m4/m4-${M4_VERSION}.tar.gz - gzip -dc m4-${M4_VERSION}.tar.gz | tar -xf - - cd m4-${M4_VERSION} - ./configure --prefix=${AUTOTOOLS} --silent - make -s -j 8 install > qout 2>&1 - make -s -j 8 distclean >> qout 2>&1 - - wget -q https://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.gz - gzip -dc autoconf-${AUTOCONF_VERSION}.tar.gz | tar -xf - - cd autoconf-${AUTOCONF_VERSION} - ./configure --prefix=${AUTOTOOLS} --silent - make -s -j 8 install > qout 2>&1 - make -s -j 8 distclean >> qout 2>&1 - - wget -q https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.gz - gzip -dc automake-${AUTOMAKE_VERSION}.tar.gz | tar -xf - - cd automake-${AUTOMAKE_VERSION} - ./configure --prefix=${AUTOTOOLS} --silent - make -s -j 8 install > qout 2>&1 - make -s -j 8 distclean >> qout 2>&1 - - wget -q https://ftp.gnu.org/gnu/libtool/libtool-${LIBTOOL_VERSION}.tar.gz - gzip -dc libtool-${LIBTOOL_VERSION}.tar.gz | tar -xf - - cd libtool-${LIBTOOL_VERSION} - ./configure --prefix=${AUTOTOOLS} --silent - make -s -j 8 install > qout 2>&1 - make -s -j 8 distclean >> qout 2>&1 - echo "LD_LIBRARY_PATH=${AUTOTOOLS}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - echo "PATH=${AUTOTOOLS}/bin:$PATH" >> $GITHUB_ENV - - - name: Add (autotools) to Paths - run: | - echo "LD_LIBRARY_PATH=${AUTOTOOLS}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - echo "PATH=${AUTOTOOLS}/bin:$PATH" >> $GITHUB_ENV - - - name: Cache PnetCDF - id: cache-pnetcdf - uses: actions/cache@v4 - with: - path: /home/runner/PnetCDF - key: cache-PnetCDF-${{env.fortran-compiler}}-key - - - name: Install PnetCDF - if: steps.cache-PnetCDF.outputs.cache-hit != 'true' - run: | - set -x - echo "LD_LIBRARY_PATH=${AUTOTOOLS}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - echo "PATH=${AUTOTOOLS}/bin:$PATH" >> $GITHUB_ENV - m4 --version - autoconf --version - automake --version - libtool --version - echo "Install PnetCDF on ${PNETCDF}" - rm -rf PnetCDF ; mkdir PnetCDF ; cd PnetCDF - git clone -q https://github.com/Parallel-NetCDF/PnetCDF.git - cd PnetCDF - autoreconf -i - ./configure --prefix=${PNETCDF} --with-mpi=${OMPI} - make -j 8 install - echo "PATH=${PNETCDF}/bin:$PATH" >> $GITHUB_ENV - - - name: Add (PNETCDF) to paths. + echo "PATH=/opt/intel/oneapi/mpi/latest/bin:${PATH}" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=/opt/intel/oneapi/mpi/latest/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV + echo "CC=mpiicx" >> $GITHUB_ENV + echo "CXX=mpiicpx" >> $GITHUB_ENV + echo "FC=mpiifx" >> $GITHUB_ENV + echo "MPICC=/opt/intel/oneapi/mpi/latest/bin/mpiicx" >> $GITHUB_ENV + + - name: Setup PnetCDF run: | - echo "PNETCDF=${PNETCDF}" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${PNETCDF}/lib" >> $GITHUB_ENV - echo "PATH=$PATH:${PNETCDF}/bin" >> $GITHUB_ENV + echo "PNETCDF=/opt/pnetcdf" >> $GITHUB_ENV - ########################################################################################## - # Step 1: Setup configuration for current test - ########################################################################################## - name: Configuration for MPAS-Dev (baseline) tests. if: contains(matrix.repo, 'MPAS-Dev') run: | @@ -210,38 +110,18 @@ jobs: - name: Configuration for ufs-community (baseline) tests. if: contains(matrix.repo, 'ufs-community') run: | - echo "nml_suffix=gsl" >> $GITHUB_ENV - - - name: Set test variables. - id: set_vars - run: | - echo "init_file=mpas.${code_base}.${nml}.${domain}.${res}.${ic_source}.init.${yyyy}'-'${mm}'-'${dd}'_'${hh}'.00.00'.nc" >> $GITHUB_OUTPUT - echo "lbc_file=mpas.${code_base}.${nml}.${domain}.${res}.${ic_source}.lbc.${yyyy}'-'${mm}'-'${dd}'_'${hh}'.00.00'.nc" >> $GITHUB_OUTPUT - echo "sst_file=mpas.${code_base}.${nml}.${domain}.${res}.${ic_source}.sfc_update.${yyyy}'-'${mm}'-'${dd}'_'${hh}'.00.00'.nc" >> $GITHUB_OUTPUT - echo "ugwp_file=mpas.${code_base}.${nml}.${domain}.${res}.ugwp_oro_data.nc" >> $GITHUB_OUTPUT - - - name: Display configuration - run: | - echo ${{steps.set_vars.outputs.init_file}} - echo ${{steps.set_vars.outputs.lbc_file}} - echo ${{steps.set_vars.outputs.sst_file}} - echo ${{steps.set_vars.outputs.ugwp_file}} - echo ${nml} - echo ${nml_version} - echo ${code_base} - echo ${case_base} + echo "nml_suffix=gsl" >> $GITHUB_ENV ########################################################################################## - # Step 2: Clone MPAS and build. + # Step 2a: Clone MPAS and build. (baselines) ########################################################################################## - - name: Checkout and build MPAS standalone for baseline generation (Debug) if: contains(matrix.build-type, 'Debug') run: | cd ${runner_ROOT} git clone --recursive --branch ${{matrix.branch}} https://github.com/${{matrix.repo}}/MPAS-Model.git MPAS-Model-BL cd ${mpas_bl_ROOT} - make gfortran CORE=atmosphere DEBUG=true + make ${{matrix.bld_target}} CORE=atmosphere DEBUG=true - name: Checkout and build MPAS standalone for baseline generation (Release) if: contains(matrix.build-type, 'Release') @@ -249,149 +129,111 @@ jobs: cd ${runner_ROOT} git clone --recursive --branch ${{matrix.branch}} https://github.com/${{matrix.repo}}/MPAS-Model.git MPAS-Model-BL cd ${mpas_bl_ROOT} - make gfortran CORE=atmosphere + make ${{matrix.bld_target}} CORE=atmosphere + ########################################################################################## + # Step 2b: Clone MPAS and build (feature branch) + ########################################################################################## - name: Checkout MPAS codebase for testing. uses: actions/checkout@v3 - name: Initialize any submodules from testing codebase. run: | + git config --global --add safe.directory ${MPAS_ROOT} + cd ${MPAS_ROOT} git submodule update --init --recursive - name: Build MPAS standalone for testing (Debug) if: contains(matrix.build-type, 'Debug') run: | - cd ${mpas_rt_ROOT}/MPAS-Model - make gfortran CORE=atmosphere DEBUG=true + cd ${MPAS_ROOT} + make ${{matrix.bld_target}} CORE=atmosphere DEBUG=true - name: Build MPAS standalone for testing (Release) if: contains(matrix.build-type, 'Release') run: | - cd ${mpas_rt_ROOT}/MPAS-Model - make gfortran CORE=atmosphere + cd ${MPAS_ROOT} + make ${{matrix.bld_target}} CORE=atmosphere ########################################################################################## # Step 3: Fetch any data/files needed for MPAS runs. ########################################################################################## - name: Download MPAS data (grid info, IC and LBC files) run: | - cd ${mpas_run_ROOT} && mkdir run_data && cd run_data - wget -q https://gsl.noaa.gov/${grid_dir}/${domain}.${res}.graph.info.part.${nproc} - wget -q -e robots=off -nH --cut-dirs N -nc -r -lX -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \ - https://gsl.noaa.gov/thredds/catalog/${case_dir}/${case_base}/${nml}.${code_base}.${domain}.${res}.${ic_source}.${yyyy}${mm}${dd}${hh}/case_files/catalog.html - mv thredds/fileServer/${case_dir}/${case_base}/${nml}.${code_base}.${domain}.${res}.${ic_source}.${yyyy}${mm}${dd}${hh}/case_files/* . - rm -rf thredds - - - name: Download MPAS testing repository with runtime configurations. - run: | - cd ${mpas_run_ROOT} - git clone --recursive --branch main https://github.com/barlage/mpas_testcase.git - - - name: Cache Thompson MP tables - id: cache-thompson-data - uses: actions/cache@v4 - with: - path: /home/runner/thompson - key: cache-thompson-data-key - - - name: Download Thompson MP tables - if: steps.cache-thompson-data.outputs.cache-hit != 'true' - run: | - cd ${runner_ROOT} && mkdir thompson && cd thompson - wget -q -e robots=off -nH --cut-dirs N -nc -r -lX -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \ - https://gsl.noaa.gov/thredds/catalog/${mpdata_dir}/thompson/catalog.html - mv thredds/fileServer/${mpdata_dir}/thompson/* . - rm -rf thredds - - - name: Cache UGWD data - id: cache-ugw-data - uses: actions/cache@v4 - with: - path: /home/runner/ugw - key: cache-ugw-data-key - - - name: Download GWD data - if: steps.cache-ugw-data.outputs.cache-hit != 'true' - run: | - cd ${runner_ROOT} && mkdir ugw && cd ugw - wget -q -e robots=off -nH --cut-dirs N -nc -r -lX -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \ - https://gsl.noaa.gov/thredds/catalog/${mpdata_dir}/ugw/catalog.html - mv thredds/fileServer/${mpdata_dir}/ugw/* . - rm -rf thredds + cd ${MPAS_ROOT} + ./testing_and_setup/ufs-community/data/get_data.sh ########################################################################################## # Step 4a: Configure MPAS baseline runs ########################################################################################## - name: Create and populate run directory (baselines) run: | - cd ${mpas_run_ROOT} && mkdir run_bl && cd run_bl - cp ${mpas_run_ROOT}/mpas_testcase/run_case/case_files/${nml_version}/${domain}/${ic_source}.${yyyy}${mm}${dd}${hh}/${{matrix.physics}}/* . + cd ${runner_ROOT} && mkdir run_bl && cd run_bl + cp ${MPAS_ROOT}/testing_and_setup/ufs-community/cases/mpasdev.${{matrix.physics}}.${ic_source}.winter/* . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.TBL . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.DBL . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*DATA . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_noahmp/parameters/NoahmpTable.TBL . - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.init_file}} mpas.init.nc - ln -sf ${mpas_run_ROOT}/run_data/${domain}.${res}.graph.info.part.${nproc} graph.info.part.${nproc} - ln -sf /home/runner/MPAS-Model-BL/atmosphere_model . - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.sst_file}} mpas.sfc_update.nc + ln -sf ${mpas_bl_ROOT}/atmosphere_model . + ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.init.nc . + ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.ugwp_oro_data.nc . + ln -sf ${MPAS_ROOT}/${mpas_ics}/graph.info.part.2 . ln -sf namelist.atmosphere.${{env.nml_suffix}} namelist.atmosphere - name: Link lateral boundary condition file for regional MPAS. - if: env.domain == 'conus' run: | - cd ${mpas_run_ROOT}/run_bl - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.lbc_file}} mpas.lbc.nc + cd ${runner_ROOT}/run_bl + ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.lbc.nc. - name: Link Thompson MP data tables to run directory if: contains(matrix.physics, 'convection_permitting') run: | - cd ${mpas_run_ROOT}/run_bl - cp ${runner_ROOT}/thompson/* . + cd ${runner_ROOT}/run_bl + cp ${MPAS_ROOT}/testing_and_setup/ufs-community/data/tables/thompson/* . ########################################################################################## # Step 4b: Configure MPAS feature runs ########################################################################################## - name: Create and populate run directory (feature test) run: | - cd ${mpas_run_ROOT} && mkdir run_rt && cd run_rt - cp ${mpas_run_ROOT}/mpas_testcase/run_case/case_files/${nml_version}/${domain}/${ic_source}.${yyyy}${mm}${dd}${hh}/${{matrix.physics}}/* . - ln -sf ${mpas_rt_ROOT}/MPAS-Model/src/core_atmosphere/physics/physics_wrf/files/*.TBL . - ln -sf ${mpas_rt_ROOT}/MPAS-Model/src/core_atmosphere/physics/physics_wrf/files/*.DBL . - ln -sf ${mpas_rt_ROOT}/MPAS-Model/src/core_atmosphere/physics/physics_wrf/files/*DATA . - ln -sf ${mpas_rt_ROOT}/MPAS-Model/src/core_atmosphere/physics/physics_noahmp/parameters/NoahmpTable.TBL . - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.init_file}} mpas.init.nc - ln -sf ${mpas_run_ROOT}/run_data/${domain}.${res}.graph.info.part.${nproc} graph.info.part.${nproc} - ln -sf ${mpas_rt_ROOT}/MPAS-Model/atmosphere_model . - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.sst_file}} mpas.sfc_update.nc + cd ${runner_ROOT} && mkdir run_rt && cd run_rt + cp ${MPAS_ROOT}/testing_and_setup/ufs-community/cases/mpasdev.${{matrix.physics}}.${ic_source}.winter/* . + ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.TBL . + ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.DBL . + ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*DATA . + ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_noahmp/parameters/NoahmpTable.TBL . + ln -sf ${MPAS_ROOT}/atmosphere_model . + ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.init.nc . + ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.ugwp_oro_data.nc . + ln -sf ${MPAS_ROOT}/${mpas_ics}/graph.info.part.2 . ln -sf namelist.atmosphere.gsl namelist.atmosphere - name: Link lateral boundary condition file for regional MPAS. - if: env.domain == 'conus' run: | - cd ${mpas_run_ROOT}/run_rt - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.lbc_file}} mpas.lbc.nc + cd ${runner_ROOT}/run_rt + ln -sf ${MPAS_ROOT}/${mpas_ics}/mpas.lbc.nc . - name: Link Thompson MP data tables to run directory if: contains(matrix.physics, 'convection_permitting') run: | - cd ${mpas_run_ROOT}/run_rt - cp ${runner_ROOT}/thompson/* . + cd ${runner_ROOT}/run_rt + cp ${MPAS_ROOT}/testing_and_setup/ufs-community/data/tables/thompson/* . ########################################################################################## # Step 5: Run MPAS ########################################################################################## - name: Run MPAS (baselines) run: | - cd ${mpas_run_ROOT}/run_bl + cd ${runner_ROOT}/run_bl pwd && ls -l - mpiexec -np 1 ./atmosphere_model + mpiexec --allow-run-as-root -np 1 ./atmosphere_model pwd && ls -l - name: Run MPAS (feature branch) run: | - cd ${mpas_run_ROOT}/run_rt + cd ${runner_ROOT}/run_rt pwd && ls -l - mpiexec -np 1 ./atmosphere_model + mpiexec --allow-run-as-root -np 1 ./atmosphere_model pwd && ls -l ########################################################################################## @@ -409,8 +251,8 @@ jobs: - name: Run comparison script id: cmp run: | - cd ${mpas_rt_ROOT}/MPAS-Model/testing_and_setup/ufs-community - ./cmp_rt2bl.py --dir_rt ${mpas_run_ROOT}/run_rt --dir_bl ${mpas_run_ROOT}/run_bl + cd ${MPAS_ROOT}/testing_and_setup/ufs-community + ./cmp_rt2bl.py --dir_rt ${runner_ROOT}/run_rt --dir_bl ${runner_ROOT}/run_bl ########################################################################################## # Step 7: Save MPAS output and log files as GitHub Artifact. @@ -418,20 +260,20 @@ jobs: - name: Create GitHub artifact run: | cd ${runner_ROOT} - mkdir artifact-${{env.fortran-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} - cd artifact-${{env.fortran-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} + mkdir artifact-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} + cd artifact-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} mkdir data_bl && cd data_bl - cp ${mpas_run_ROOT}/run_bl/log.atmosphere.*.out log.atmosphere.BL.out - cp ${mpas_run_ROOT}/run_bl/history.*.nc . - cp ${mpas_run_ROOT}/run_bl/diag.*.nc . + cp ${runner_ROOT}/run_bl/log.atmosphere.*.out log.atmosphere.BL.out + cp ${runner_ROOT}/run_bl/history.*.nc . + cp ${runner_ROOT}/run_bl/diag.*.nc . cd .. mkdir data_rt && cd data_rt - cp ${mpas_run_ROOT}/run_rt/log.atmosphere.*.out log.atmosphere.RT.out - cp ${mpas_run_ROOT}/run_rt/history.*.nc . - cp ${mpas_run_ROOT}/run_rt/diag.*.nc . + cp ${runner_ROOT}/run_rt/log.atmosphere.*.out log.atmosphere.RT.out + cp ${runner_ROOT}/run_rt/history.*.nc . + cp ${runner_ROOT}/run_rt/diag.*.nc . - name: Upload log files as GitHub Artifact uses: actions/upload-artifact@v4 with: - name: mpas-baselines-${{env.fortran-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} - path: /home/runner/artifact-${{env.fortran-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} + name: mpas-baselines-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} + path: /__w/artifact-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.repo}}-${{matrix.physics}} diff --git a/.github/workflows/run_mpas_hrrr.yml b/.github/workflows/run_mpas_hrrr.yml index 874d8c335a..655c70b6ec 100644 --- a/.github/workflows/run_mpas_hrrr.yml +++ b/.github/workflows/run_mpas_hrrr.yml @@ -5,13 +5,11 @@ on: [push, pull_request, workflow_dispatch] ############################################################################################# # Testing script/workflow for ufs-community fork of MPAS-Dev/MPAS-A. # -# Description (outside of software stack setup (Step 0)) +# Description # # - Clone and build MPAS for baseline generation. # - Clone and build MPAS for feature branch testing (against baselines). -# - Clone ufs-community MPAS testing repository. -# - Fetch data from THREDDS server. -# - Donwload any other data (e.g. MP tables, etc). +# - Download any data (MP tables, MPAS ICs/LBCs/etc...). # - Create/populate MPAS run directories. # - Run MPAS using baseline codebase/configuration. # - Run MPAS using feature branch. @@ -22,10 +20,6 @@ on: [push, pull_request, workflow_dispatch] # - The test build/run configurations matrix is described below. # - This script uses a matrix run configuration with exclusions to achieve the desired "run list" # -# - List of physics configuration to test. See https://github.com/barlage/mpas_testcase.git -# - Baseline codebase repository. -# - Baseline codebase repository branch. -# # Tests: # Baseline Codebase Repository:Branch Physics IC source season build-type # 1/4) ufs-community:gsl/develop hrrrv5 gfs winter Release/Debug @@ -35,17 +29,27 @@ on: [push, pull_request, workflow_dispatch] ############################################################################################# jobs: run_mpas_hrrr: - # runs-on: ubuntu-22.04 strategy: fail-fast: false # Disable fail-fast matrix: + f-compiler: [gfortran]#,ifx] ic_source: [gfs, rap] season: [summer, winter] build-type: [Release] exclude: - ic_source: gfs season: summer + include: + # Set container images for each compiler + - f-compiler: gfortran + bld_target: gfortran + image: dustinswales/ufs-community-mpas-ci:gnu +# - f-compiler: ifx +# bld_target: intel +# image: dustinswales/ufs-community-mpas-ci:oneapi + container: + image: ${{ matrix.image }} # defaults: run: @@ -53,349 +57,150 @@ jobs: # Environmental variables env: - physics: hrrrv5 - repo: ufs-community - branch: gsl/develop - fortran-compiler: gfortran-12 - py-version: 3.11 - runner_ROOT: /home/runner - mpas_rt_ROOT: /home/runner/work/MPAS-Model - mpas_bl_ROOT: /home/runner/MPAS-Model-BL - mpas_run_ROOT: /home/runner/work - AUTOCONF_VERSION: 2.71 - AUTOMAKE_VERSION: 1.17 - M4_VERSION: 1.4.19 - LIBTOOL_VERSION: 2.5.4 - PNETCDF: /home/runner/PnetCDF - AUTOTOOLS: /home/runner/AUTOTOOLS - OMPI: /home/runner/ompi-4.1.6 - grid_dir: thredds/catalog/retro/mpas_ci/mpas_test_data/grid - case_dir: retro/mpas_ci/mpas_test_data/run_case_input/create_case_output - mpdata_dir: retro/mpas_ci/mpas_test_data/run_case_input/tables - domain: conus - res: 120km - nproc: 2 - nml: gsl - case_base: gsl-v8.3.0-1.8-intelmpi - code_base: gsl - nml_version: gsl - + physics: hrrrv5 + py-version: 3.11 + runner_ROOT: /__w/ + MPAS_ROOT: /__w/MPAS-Model/MPAS-Model + mpas_bl_ROOT: /__w/MPAS-Model-BL + PNETCDF: /opt/pnetcdf + mpas_ics: testing_and_setup/ufs-community/data/ics/ufscommunity + physics_tables: testing_and_setup/ufs-community/data/tables # Workflow steps steps: ########################################################################################## - # Step 0: Build Software Stack needed for MPAS on GitHub server. + # Step 1: Setup ########################################################################################## - - name: Install NetCDF library - run: | - sudo apt-get update - sudo apt-get install libnetcdff-dev - - - name: Cache openmpi - id: cache-openmpi - uses: actions/cache@v4 - with: - path: /home/runner/ompi-4.1.6 - key: cache-openmpi-${{env.fortran-compiler}}-key - - - name: Install openmpi - if: steps.cache-openmpi.outputs.cache-hit != 'true' + - name: Setup MPI (GNU) + if: matrix.f-compiler == 'gfortran' run: | - wget https://github.com/open-mpi/ompi/archive/refs/tags/v4.1.6.tar.gz - tar -xvf v4.1.6.tar.gz - cd ompi-4.1.6 - ./autogen.pl - ./configure --prefix=${OMPI} - make -j4 - make install + echo "CC=mpicc" >> $GITHUB_ENV + echo "CXX=mpicxx" >> $GITHUB_ENV + echo "FC=mpif90" >> $GITHUB_ENV - - name: Add (OMPI) to Paths + - name: Setup PnetCDF run: | - echo "LD_LIBRARY_PATH=${OMPI}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - echo "PATH=${OMPI}/bin:$PATH" >> $GITHUB_ENV - - - name: Cache GNU autotools - id: cache-AUTOTOOLS - uses: actions/cache@v4 - with: - path: /home/runner/AUTOTOOLS - key: cache-AUTOTOOLS-${{env.fortran-compiler}}-key - - - name: Build GNU autotools - if: steps.cache-AUTOTOOLS.outputs.cache-hit != 'true' - run: | - wget -q https://ftp.gnu.org/gnu/m4/m4-${M4_VERSION}.tar.gz - gzip -dc m4-${M4_VERSION}.tar.gz | tar -xf - - cd m4-${M4_VERSION} - ./configure --prefix=${AUTOTOOLS} --silent - make -s -j 8 install > qout 2>&1 - make -s -j 8 distclean >> qout 2>&1 - - wget -q https://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.gz - gzip -dc autoconf-${AUTOCONF_VERSION}.tar.gz | tar -xf - - cd autoconf-${AUTOCONF_VERSION} - ./configure --prefix=${AUTOTOOLS} --silent - make -s -j 8 install > qout 2>&1 - make -s -j 8 distclean >> qout 2>&1 - - wget -q https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.gz - gzip -dc automake-${AUTOMAKE_VERSION}.tar.gz | tar -xf - - cd automake-${AUTOMAKE_VERSION} - ./configure --prefix=${AUTOTOOLS} --silent - make -s -j 8 install > qout 2>&1 - make -s -j 8 distclean >> qout 2>&1 - - wget -q https://ftp.gnu.org/gnu/libtool/libtool-${LIBTOOL_VERSION}.tar.gz - gzip -dc libtool-${LIBTOOL_VERSION}.tar.gz | tar -xf - - cd libtool-${LIBTOOL_VERSION} - ./configure --prefix=${AUTOTOOLS} --silent - make -s -j 8 install > qout 2>&1 - make -s -j 8 distclean >> qout 2>&1 - echo "LD_LIBRARY_PATH=${AUTOTOOLS}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - echo "PATH=${AUTOTOOLS}/bin:$PATH" >> $GITHUB_ENV - - - name: Add (autotools) to Paths - run: | - echo "LD_LIBRARY_PATH=${AUTOTOOLS}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - echo "PATH=${AUTOTOOLS}/bin:$PATH" >> $GITHUB_ENV - - - name: Cache PnetCDF - id: cache-pnetcdf - uses: actions/cache@v4 - with: - path: /home/runner/PnetCDF - key: cache-PnetCDF-${{env.fortran-compiler}}-key - - - name: Install PnetCDF - if: steps.cache-PnetCDF.outputs.cache-hit != 'true' - run: | - set -x - echo "LD_LIBRARY_PATH=${AUTOTOOLS}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV - echo "PATH=${AUTOTOOLS}/bin:$PATH" >> $GITHUB_ENV - m4 --version - autoconf --version - automake --version - libtool --version - echo "Install PnetCDF on ${PNETCDF}" - rm -rf PnetCDF ; mkdir PnetCDF ; cd PnetCDF - git clone -q https://github.com/Parallel-NetCDF/PnetCDF.git - cd PnetCDF - autoreconf -i - ./configure --prefix=${PNETCDF} --with-mpi=${OMPI} - make -j 8 install - echo "PATH=${PNETCDF}/bin:$PATH" >> $GITHUB_ENV - - - name: Add (PNETCDF) to paths. - run: | - echo "PNETCDF=${PNETCDF}" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${PNETCDF}/lib" >> $GITHUB_ENV - echo "PATH=$PATH:${PNETCDF}/bin" >> $GITHUB_ENV - - ########################################################################################## - # Step 1: Setup configuration for current test - ########################################################################################## - - name: Set tests start time (GFS case) - if: contains(matrix.ic_source, 'gfs') - run: | - echo "yyyy=2023" >> $GITHUB_ENV - echo "mm=03" >> $GITHUB_ENV - echo "dd=10" >> $GITHUB_ENV - echo "hh=15" >> $GITHUB_ENV - - - name: Set test start time (RAP summer case). - if: contains(matrix.season, 'summer') && contains(matrix.ic_source, 'rap') - run: | - echo "yyyy=2024" >> $GITHUB_ENV - echo "mm=08" >> $GITHUB_ENV - echo "dd=15" >> $GITHUB_ENV - echo "hh=18" >> $GITHUB_ENV - - - name: Set test start time (RAP winter case). - if: contains(matrix.season, 'winter') && contains(matrix.ic_source, 'rap') - run: | - echo "yyyy=2024" >> $GITHUB_ENV - echo "mm=02" >> $GITHUB_ENV - echo "dd=02" >> $GITHUB_ENV - echo "hh=18" >> $GITHUB_ENV - - - name: Set test variables. - id: set_vars - run: | - echo "init_file=mpas.${code_base}.${nml}.${domain}.${res}.${{matrix.ic_source}}.init.${yyyy}'-'${mm}'-'${dd}'_'${hh}'.00.00'.nc" >> $GITHUB_OUTPUT - echo "lbc_file=mpas.${code_base}.${nml}.${domain}.${res}.${{matrix.ic_source}}.lbc.${yyyy}'-'${mm}'-'${dd}'_'${hh}'.00.00'.nc" >> $GITHUB_OUTPUT - echo "sst_file=mpas.${code_base}.${nml}.${domain}.${res}.${{matrix.ic_source}}.sfc_update.${yyyy}'-'${mm}'-'${dd}'_'${hh}'.00.00'.nc" >> $GITHUB_OUTPUT - echo "ugwp_file=mpas.${code_base}.${nml}.${domain}.${res}.ugwp_oro_data.nc" >> $GITHUB_OUTPUT - - - name: Display configuration - run: | - echo ${{steps.set_vars.outputs.init_file}} - echo ${{steps.set_vars.outputs.lbc_file}} - echo ${{steps.set_vars.outputs.sst_file}} - echo ${{steps.set_vars.outputs.ugwp_file}} + echo "PNETCDF=/opt/pnetcdf" >> $GITHUB_ENV ########################################################################################## - # Step 2: Clone MPAS and build. + # Step 2a: Clone MPAS and build. (baselines) ########################################################################################## - name: Checkout and build MPAS standalone for baseline generation (Debug) if: contains(matrix.build-type, 'Debug') run: | cd ${runner_ROOT} - git clone --recursive --branch ${{env.branch}} https://github.com/${{env.repo}}/MPAS-Model.git MPAS-Model-BL + git clone --recursive --branch gsl/develop https://github.com/ufs-community/MPAS-Model.git MPAS-Model-BL cd ${mpas_bl_ROOT} - make gfortran CORE=atmosphere DEBUG=true + make ${{matrix.bld_target}} CORE=atmosphere DEBUG=true - name: Checkout and build MPAS standalone for baseline generation (Release) if: contains(matrix.build-type, 'Release') run: | cd ${runner_ROOT} - git clone --recursive --branch ${{env.branch}} https://github.com/${{env.repo}}/MPAS-Model.git MPAS-Model-BL + git clone --recursive --branch gsl/develop https://github.com/ufs-community/MPAS-Model.git MPAS-Model-BL cd ${mpas_bl_ROOT} - make gfortran CORE=atmosphere + make ${{matrix.bld_target}} CORE=atmosphere + ########################################################################################## + # Step 2b: Clone MPAS and build (feature branch) + ########################################################################################## - name: Checkout MPAS codebase for testing. uses: actions/checkout@v3 - name: Initialize any submodules from testing codebase. run: | + git config --global --add safe.directory ${MPAS_ROOT} + cd ${MPAS_ROOT} git submodule update --init --recursive - name: Build MPAS standalone for testing (Debug) if: contains(matrix.build-type, 'Debug') run: | - cd ${mpas_rt_ROOT}/MPAS-Model - make gfortran CORE=atmosphere DEBUG=true + cd ${MPAS_ROOT} + make ${{matrix.bld_target}} CORE=atmosphere DEBUG=true - name: Build MPAS standalone for testing (Release) if: contains(matrix.build-type, 'Release') run: | - cd ${mpas_rt_ROOT}/MPAS-Model - make gfortran CORE=atmosphere + cd ${MPAS_ROOT} + make ${{matrix.bld_target}} CORE=atmosphere ########################################################################################## # Step 3: Fetch any data/files needed for MPAS runs. ########################################################################################## - name: Download MPAS data (grid info, IC and LBC files) run: | - cd ${mpas_run_ROOT} && mkdir run_data && cd run_data - wget -q https://gsl.noaa.gov/${grid_dir}/${domain}.${res}.graph.info.part.${nproc} - wget -q -e robots=off -nH --cut-dirs N -nc -r -lX -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \ - https://gsl.noaa.gov/thredds/catalog/${case_dir}/${case_base}/${nml}.${code_base}.${domain}.${res}.${{matrix.ic_source}}.${yyyy}${mm}${dd}${hh}/case_files/catalog.html - mv thredds/fileServer/${case_dir}/${case_base}/${nml}.${code_base}.${domain}.${res}.${{matrix.ic_source}}.${yyyy}${mm}${dd}${hh}/case_files/* . - rm -rf thredds - - - name: Download MPAS testing repository with runtime configurations. - run: | - cd ${mpas_run_ROOT} - git clone --recursive --branch main https://github.com/barlage/mpas_testcase.git - - - name: Cache TEMPO MP tables - id: cache-tempo-data - uses: actions/cache@v4 - with: - path: /home/runner/tempo - key: cache-tempo-data-key - - - name: Download TEMPO MP tables - if: steps.cache-tempo-data.outputs.cache-hit != 'true' - run: | - cd ${runner_ROOT} && mkdir tempo && cd tempo - wget -q -e robots=off -nH --cut-dirs N -nc -r -lX -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \ - https://gsl.noaa.gov/thredds/catalog/${mpdata_dir}/tempo/catalog.html - mv thredds/fileServer/${mpdata_dir}/tempo/* . - rm -rf thredds - - - name: Cache UGWD data - id: cache-ugw-data - uses: actions/cache@v4 - with: - path: /home/runner/ugw - key: cache-ugw-data-key - - - name: Download GWD data - if: steps.cache-ugw-data.outputs.cache-hit != 'true' - run: | - cd ${runner_ROOT} && mkdir ugw && cd ugw - wget -q -e robots=off -nH --cut-dirs N -nc -r -lX -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \ - https://gsl.noaa.gov/thredds/catalog/${mpdata_dir}/ugw/catalog.html - mv thredds/fileServer/${mpdata_dir}/ugw/* . - rm -rf thredds + cd ${MPAS_ROOT} + ./testing_and_setup/ufs-community/data/get_data.sh ########################################################################################## # Step 4a: Configure MPAS baseline runs ########################################################################################## - name: Create and populate run directory (baselines) run: | - cd ${mpas_run_ROOT} && mkdir run_bl && cd run_bl - cp ${mpas_run_ROOT}/mpas_testcase/run_case/case_files/${nml_version}/${domain}/${{matrix.ic_source}}.${yyyy}${mm}${dd}${hh}/${{env.physics}}/* . + cd ${runner_ROOT} && mkdir run_bl && cd run_bl + cp ${MPAS_ROOT}/testing_and_setup/ufs-community/cases/ufscommunity.${{env.physics}}.${{matrix.ic_source}}.${{matrix.season}}/* . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.TBL . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.DBL . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*DATA . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_noahmp/parameters/NoahmpTable.TBL . - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.init_file}} mpas.init.nc - ln -sf ${mpas_run_ROOT}/run_data/${domain}.${res}.graph.info.part.${nproc} graph.info.part.${nproc} - ln -sf ${mpas_bl_ROOT}/atmosphere_model atmosphere_model - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.ugwp_file}} mpas.ugwp_oro_data.nc - ln -sf ${runner_ROOT}/tempo/* . - ln -sf ${runner_ROOT}/ugw/ugwp_limb_tau.nc . - - - name: Link lateral boundary condition file for regional MPAS (baselines). - if: env.domain == 'conus' - run: | - cd ${mpas_run_ROOT}/run_bl - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.lbc_file}} mpas.lbc.nc + ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_noaa/TEMPO/tables/ccn_activate.bin . + ln -sf ${MPAS_ROOT}/${mpas_ics}.${{matrix.ic_source}}.${{matrix.season}}/mpas.init.nc . + ln -sf ${MPAS_ROOT}/${mpas_ics}.${{matrix.ic_source}}.${{matrix.season}}/mpas.ugwp_oro_data.nc . + ln -sf ${MPAS_ROOT}/${mpas_ics}.${{matrix.ic_source}}.${{matrix.season}}/mpas.lbc.nc . + ln -sf ${MPAS_ROOT}/${mpas_ics}.${{matrix.ic_source}}.${{matrix.season}}/graph.info.part.2 . + ln -sf ${MPAS_ROOT}/${physics_tables}/tempo/* . + ln -sf ${MPAS_ROOT}/${physics_tables}/ugw/* . + ln -sf ${mpas_bl_ROOT}/atmosphere_model . - name: Link surface files to run directory (baselines) if: ${{matrix.ic_source}} == 'gfs' run: | - cd ${mpas_run_ROOT}/run_bl - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.sst_file}} mpas.sfc_update.nc + cd ${runner_ROOT}/run_bl + ln -sf ${MPAS_ROOT}/${mpas_ics}.${{matrix.ic_source}}.${{matrix.season}}/mpas.sfc_update.nc . ########################################################################################## # Step 4b: Configure MPAS feature runs ########################################################################################## - name: Create and populate run directory (feature test) run: | - cd ${mpas_run_ROOT} && mkdir run_rt && cd run_rt - cp ${mpas_run_ROOT}/mpas_testcase/run_case/case_files/${nml_version}/${domain}/${{matrix.ic_source}}.${yyyy}${mm}${dd}${hh}/${{env.physics}}/* . - ln -sf ${mpas_rt_ROOT}/MPAS-Model/src/core_atmosphere/physics/physics_wrf/files/*.TBL . - ln -sf ${mpas_rt_ROOT}/MPAS-Model/src/core_atmosphere/physics/physics_wrf/files/*.DBL . - ln -sf ${mpas_rt_ROOT}/MPAS-Model/src/core_atmosphere/physics/physics_wrf/files/*DATA . - ln -sf ${mpas_rt_ROOT}/MPAS-Model/src/core_atmosphere/physics/physics_noahmp/parameters/NoahmpTable.TBL . - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.init_file}} mpas.init.nc - ln -sf ${mpas_run_ROOT}/run_data/${domain}.${res}.graph.info.part.${nproc} graph.info.part.${nproc} - ln -sf ${mpas_rt_ROOT}/MPAS-Model/atmosphere_model atmosphere_model - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.ugwp_file}} mpas.ugwp_oro_data.nc - ln -sf ${runner_ROOT}/tempo/* . - ln -sf ${runner_ROOT}/ugw/ugwp_limb_tau.nc . - - - name: Link lateral boundary condition file for regional MPAS (feature) - if: env.domain == 'conus' - run: | - cd ${mpas_run_ROOT}/run_rt - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.lbc_file}} mpas.lbc.nc + cd ${runner_ROOT} && mkdir run_rt && cd run_rt + cp ${MPAS_ROOT}/testing_and_setup/ufs-community/cases/ufscommunity.${{env.physics}}.${{matrix.ic_source}}.${{matrix.season}}/* . + ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.TBL . + ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.DBL . + ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*DATA . + ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_noahmp/parameters/NoahmpTable.TBL . + ln -sf ${MPAS_ROOT}/src/core_atmosphere/physics/physics_noaa/TEMPO/tables/ccn_activate.bin . + ln -sf ${MPAS_ROOT}/${mpas_ics}.${{matrix.ic_source}}.${{matrix.season}}/mpas.init.nc . + ln -sf ${MPAS_ROOT}/${mpas_ics}.${{matrix.ic_source}}.${{matrix.season}}/mpas.ugwp_oro_data.nc . + ln -sf ${MPAS_ROOT}/${mpas_ics}.${{matrix.ic_source}}.${{matrix.season}}/mpas.lbc.nc . + ln -sf ${MPAS_ROOT}/${mpas_ics}.${{matrix.ic_source}}.${{matrix.season}}/graph.info.part.2 . + ln -sf ${MPAS_ROOT}/${physics_tables}/tempo/* . + ln -sf ${MPAS_ROOT}/${physics_tables}/ugw/* . + ln -sf ${MPAS_ROOT}/atmosphere_model . - name: Link surface files to run directory (feature) if: ${{matrix.ic_source}} == 'gfs' run: | - cd ${mpas_run_ROOT}/run_rt - ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.sst_file}} mpas.sfc_update.nc + cd ${runner_ROOT}/run_rt + ln -sf ${MPAS_ROOT}/${mpas_ics}.${{matrix.ic_source}}.${{matrix.season}}/mpas.sfc_update.nc . ########################################################################################## # Step 5: Run MPAS ########################################################################################## - name: Run MPAS (baselines) run: | - cd ${mpas_run_ROOT}/run_bl + cd ${runner_ROOT}/run_bl pwd && ls -l - mpiexec -np 1 ./atmosphere_model + mpiexec --allow-run-as-root -np 1 ./atmosphere_model pwd && ls -l - name: Run MPAS (feature branch) run: | - cd ${mpas_run_ROOT}/run_rt + cd ${runner_ROOT}/run_rt pwd && ls -l - mpiexec -np 1 ./atmosphere_model + mpiexec --allow-run-as-root -np 1 ./atmosphere_model pwd && ls -l ########################################################################################## @@ -412,8 +217,8 @@ jobs: - name: Run comparison script run: | - cd ${mpas_rt_ROOT}/MPAS-Model/testing_and_setup/ufs-community - ./cmp_rt2bl.py --dir_rt ${mpas_run_ROOT}/run_rt --dir_bl ${mpas_run_ROOT}/run_bl + cd ${MPAS_ROOT}/testing_and_setup/ufs-community + ./cmp_rt2bl.py --dir_rt ${runner_ROOT}/run_rt --dir_bl ${runner_ROOT}/run_bl ########################################################################################## # Step 7: Save MPAS output and log files as GitHub Artifact. @@ -421,20 +226,20 @@ jobs: - name: Create GitHub artifact run: | cd ${runner_ROOT} - mkdir artifact-${{env.fortran-compiler}}-${{matrix.build-type}}-${{matrix.ic_source}}-${{matrix.season}}-${{env.physics}} - cd artifact-${{env.fortran-compiler}}-${{matrix.build-type}}-${{matrix.ic_source}}-${{matrix.season}}-${{env.physics}} + mkdir artifact-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.ic_source}}-${{matrix.season}}-${{env.physics}} + cd artifact-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.ic_source}}-${{matrix.season}}-${{env.physics}} mkdir data_bl && cd data_bl - cp ${mpas_run_ROOT}/run_bl/log.atmosphere.*.out log.atmosphere.BL.out - cp ${mpas_run_ROOT}/run_bl/history.*.nc . - cp ${mpas_run_ROOT}/run_bl/diag.*.nc . + cp ${runner_ROOT}/run_bl/log.atmosphere.*.out log.atmosphere.BL.out + cp ${runner_ROOT}/run_bl/history.*.nc . + cp ${runner_ROOT}/run_bl/diag.*.nc . cd .. mkdir data_rt && cd data_rt - cp ${mpas_run_ROOT}/run_rt/log.atmosphere.*.out log.atmosphere.RT.out - cp ${mpas_run_ROOT}/run_rt/history.*.nc . - cp ${mpas_run_ROOT}/run_rt/diag.*.nc . + cp ${runner_ROOT}/run_rt/log.atmosphere.*.out log.atmosphere.RT.out + cp ${runner_ROOT}/run_rt/history.*.nc . + cp ${runner_ROOT}/run_rt/diag.*.nc . - name: Upload log files as GitHub Artifact uses: actions/upload-artifact@v4 with: - name: mpas-baselines-${{env.fortran-compiler}}-${{matrix.build-type}}-${{matrix.ic_source}}-${{matrix.season}}-${{env.physics}} - path: /home/runner/artifact-${{env.fortran-compiler}}-${{matrix.build-type}}-${{matrix.ic_source}}-${{matrix.season}}-${{env.physics}} + name: mpas-baselines-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.ic_source}}-${{matrix.season}}-${{env.physics}} + path: /__w/artifact-${{matrix.f-compiler}}-${{matrix.build-type}}-${{matrix.ic_source}}-${{matrix.season}}-${{env.physics}} diff --git a/.gitignore b/.gitignore index eaf71a8102..fb29b6bd68 100644 --- a/.gitignore +++ b/.gitignore @@ -53,9 +53,9 @@ restart_timestamp .build_opts* # Ignore all runtime config files -namelist.* -streams.* -stream_list.* +#namelist.* +#streams.* +#stream_list.* # Intermediate files that may be produced by Intel compilers *.i diff --git a/.gitmodules b/.gitmodules index 2d39ea815f..dc50a85f81 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,9 @@ [submodule "src/core_atmosphere/physics/physics_noaa/SMOKE"] path = src/core_atmosphere/physics/physics_noaa/SMOKE url = https://github.com/cheMPAS-Fire/SMOKE.git +[submodule "src/core_atmosphere/physics/physics_noaa/MYNN-SFC"] + path = src/core_atmosphere/physics/physics_noaa/MYNN-SFC + url = https://github.com/NCAR/MYNN-SFC.git +[submodule "src/core_atmosphere/physics/physics_mmm"] + path = src/core_atmosphere/physics/physics_mmm + url = https://github.com/NCAR/MMM-physics.git diff --git a/README.md b/README.md index fccb4461da..80c472b6d9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -MPAS-v8.3.1-2.12 +MPAS-v8.3.1-2.22 ==== The Model for Prediction Across Scales (MPAS) is a collaborative project for diff --git a/docker/Dockerfile-add-netcdf b/docker/Dockerfile-add-netcdf new file mode 100644 index 0000000000..263009edf6 --- /dev/null +++ b/docker/Dockerfile-add-netcdf @@ -0,0 +1,34 @@ +# +# Install NetCDF Fortran and its dependencies +# + +ARG TOOLCHAIN +FROM minimal-toolchain:$TOOLCHAIN + +# Install the dependencies +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get --yes install --no-install-recommends \ + curl \ + libnetcdf-dev \ + openmpi-bin \ + && rm -rf /var/lib/apt/lists/* + +# Install NetCDF Fortran +# The version must be compitible with NetCDF C installed above +ARG NFVERSION +ENV NFVERSION=$NFVERSION + +RUN curl https://downloads.unidata.ucar.edu/netcdf-fortran/$NFVERSION/netcdf-fortran-$NFVERSION.tar.gz | tar xz \ + && cd netcdf-fortran-$NFVERSION \ + && { ./configure \ + CFLAGS='-O2' \ + FCFLAGS='-O2 -fPIC' \ + --disable-static \ + --prefix=/usr || \ + { cat ./config.log; exit 1; } } +RUN cd netcdf-fortran-$NFVERSION \ + && make -j \ + && make install \ + && cd .. \ + && rm -rf netcdf-fortran-$NFVERSION \ + && ldconfig diff --git a/docker/Dockerfile-add-pnetcdf b/docker/Dockerfile-add-pnetcdf new file mode 100644 index 0000000000..d0116c4b66 --- /dev/null +++ b/docker/Dockerfile-add-pnetcdf @@ -0,0 +1,35 @@ +# +# Install Parallel NetCDF Fortran and its dependencies +# + +ARG TOOLCHAIN +FROM add-netcdf:$TOOLCHAIN + +ARG PNFVERSION +ENV PNFVERSION=$PNFVERSION + +# Set environment variables for PnetCDF installation +ENV PNETCDF_PREFIX=/opt/pnetcdf +ENV PATH="${PNETCDF_PREFIX}/bin:${PATH}" +ENV LD_LIBRARY_PATH="${PNETCDF_PREFIX}/lib:{$LD_LIBRARY_PATH}" +ENV PKG_CONFIG_PATH="${PNETCDF_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" + +# Update and install necessary build tools +RUN apt-get update && apt-get install -y --no-install-recommends \ + automake \ + libtool \ + && rm -rf /var/lib/apt/lists/* + +# Download, compile, and install PnetCDF +WORKDIR /tmp +RUN wget https://parallel-netcdf.github.io/Release/pnetcdf-${PNFVERSION}.tar.gz \ + && tar xzf pnetcdf-${PNFVERSION}.tar.gz \ + && cd pnetcdf-${PNFVERSION} \ + && CC=$CC FC=$FC ./configure --prefix=${PNETCDF_PREFIX} \ + && make -j 8 install \ + && cd /tmp \ + && rm -rf pnetcdf-${PNFVERSION} pnetcdf-${PNFVERSION}.tar.gz + +# Add PnetCDF library path to the environment +ENV PATH="${PNETCDF_PREFIX}/bin:${PATH}" +ENV LD_LIBRARY_PATH="${PNETCDF_PREFIX}/lib:${LD_LIBRARY_PATH}" diff --git a/docker/Dockerfile-add-python b/docker/Dockerfile-add-python new file mode 100644 index 0000000000..a8c71342c2 --- /dev/null +++ b/docker/Dockerfile-add-python @@ -0,0 +1,26 @@ +# +# Install Python3 and a small set of packages +# + +ARG TOOLCHAIN +FROM add-pnetcdf:$TOOLCHAIN + +# Install Python +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get --yes install --no-install-recommends \ + python-is-python3 \ + python3 \ + python3-pip \ + && rm -rf /var/lib/apt/lists/* + +# Install essential packages +RUN pip3 install --break-system-packages \ + h5py \ + netCDF4 \ + numpy \ + xarray + +# Install packages for the validation plot generation +RUN pip3 install --break-system-packages \ + matplotlib + diff --git a/docker/Dockerfile-finalize b/docker/Dockerfile-finalize new file mode 100644 index 0000000000..581663cd4e --- /dev/null +++ b/docker/Dockerfile-finalize @@ -0,0 +1,12 @@ +# +# Finalize CI containers +# + +ARG TOOLCHAIN +FROM add-python:$TOOLCHAIN + +# Install additional tools +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get --yes install --no-install-recommends \ + zstd \ + && rm -rf /var/lib/apt/lists/* diff --git a/docker/Dockerfile-gnu-minimal b/docker/Dockerfile-gnu-minimal new file mode 100644 index 0000000000..f8334e19a8 --- /dev/null +++ b/docker/Dockerfile-gnu-minimal @@ -0,0 +1,30 @@ +FROM ubuntu:24.04 + +# Extend and update the package registry +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get --yes install --no-install-recommends \ + ca-certificates \ + curl \ + wget \ + gpg \ + binutils \ + g++ \ + gcc \ + libc-dev \ + make \ + git \ + gfortran>=14 \ + cmake \ + libopenmpi-dev \ + openmpi-bin \ + ksh \ + m4 \ + tcsh \ + time \ + vim \ + file \ + libxml2 \ + gh \ + jq + +ENV FC=mpif90 CC=mpicc CXX=mpicxx \ No newline at end of file diff --git a/docker/Dockerfile-nvhpc-minimal b/docker/Dockerfile-nvhpc-minimal new file mode 100644 index 0000000000..484c6ecf2d --- /dev/null +++ b/docker/Dockerfile-nvhpc-minimal @@ -0,0 +1,33 @@ +FROM ubuntu:24.04 + +ARG NVHPC_VERSION_MAJOR='25' +ARG NVHPC_VERSION_MINOR='9' + +# Extend and update the package registry +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get --yes install --no-install-recommends \ + ca-certificates \ + curl \ + time \ + gpg \ + make \ + cmake \ + wget \ + git + RUN curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK \ + | gpg --dearmor > /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg \ + && echo "deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /" > /etc/apt/sources.list.d/nvhpc.list \ + && apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get --yes install --no-install-recommends \ + nvhpc-${NVHPC_VERSION_MAJOR}-${NVHPC_VERSION_MINOR} \ + && rm -rf /var/lib/apt/lists/* \ + && for dir in comm_libs examples math_libs profilers; do \ + rm -rf "/opt/nvidia/hpc_sdk/Linux_x86_64/${NVHPC_VERSION_MAJOR}.${NVHPC_VERSION_MINOR}/${dir}"; \ + done + +ENV PATH="/opt/nvidia/hpc_sdk/Linux_x86_64/${NVHPC_VERSION_MAJOR}.${NVHPC_VERSION_MINOR}/compilers/bin:${PATH}" + +# Set default compiler executables +ENV FC=nvfortran CC=nvc CXX=nvc++ +ENV MPICC=mpicc +#ENV FC=mpifort CC=mpicc CXX=mpic++ \ No newline at end of file diff --git a/docker/Dockerfile-oneapi-minimal b/docker/Dockerfile-oneapi-minimal new file mode 100644 index 0000000000..1b30550afe --- /dev/null +++ b/docker/Dockerfile-oneapi-minimal @@ -0,0 +1,51 @@ +FROM ubuntu:24.04 + +ARG ONEAPI_VERSION='2025.3' + +# Extend and update the package registry +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get --yes install --no-install-recommends \ + ca-certificates \ + curl \ + wget \ + gpg \ + binutils \ + g++ \ + gcc \ + gfortran \ + libc-dev \ + make \ + cmake \ + git \ + ksh \ + m4 \ + tcsh \ + time \ + vim \ + gh \ + jq +# See https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2025-2/hpc-apt.html + +RUN wget -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + | gpg --dearmor \ + | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null \ + && echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \ + | tee /etc/apt/sources.list.d/oneAPI.list \ + && apt-get update \ + && apt-get install --yes --no-install-recommends \ + intel-oneapi-common-vars \ + intel-oneapi-compiler-fortran-${ONEAPI_VERSION} \ + intel-oneapi-mpi \ + intel-oneapi-mpi-devel\ + intel-oneapi-compiler-dpcpp-cpp-${ONEAPI_VERSION} \ + && rm -rf /var/lib/apt/lists/* + +ENV PATH="/opt/intel/oneapi/compiler/latest/bin:${PATH}" +ENV LD_LIBRARY_PATH="/opt/intel/oneapi/compiler/latest/lib:${LD_LIBRARY_PATH}" + +ENV I_MPI_ROOT=/opt/intel/oneapi/mpi/latest + +# oneAPI environments +RUN . /opt/intel/oneapi/setvars.sh +ENV FC=ifx CC=icx CXX=icpx +ENV MPICC /opt/intel/oneapi/mpi/latest/bin/mpiicx \ No newline at end of file diff --git a/src/core_atmosphere/CMakeLists.txt b/src/core_atmosphere/CMakeLists.txt index 4d0f14fc7a..36f267d79c 100644 --- a/src/core_atmosphere/CMakeLists.txt +++ b/src/core_atmosphere/CMakeLists.txt @@ -99,9 +99,6 @@ set(ATMOSPHERE_CORE_PHYSICS_WRF_SOURCES module_sf_mynn.F sf_mynn_pre.F sf_sfclayrev_pre.F - module_mynnsfclay_driver.F90 - module_mynnsfclay.F90 - module_mynnsfclay_pre.F90 ) list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_WRF_SOURCES PREPEND physics/physics_wrf/) @@ -109,9 +106,10 @@ list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_WRF_SOURCES PREPEND physics/physics_wrf/) # physics/physics_noaa/GFL/ set(ATMOSPHERE_CORE_PHYSICS_GFL_SOURCES - MPAS/module_cu_gfl_mpas.F - module_cu_gfl_deep.F - module_cu_gfl_sh.F + MPAS/module_cu_gfl_common.F90 + MPAS/module_cu_gfl_mpas.F90 + module_cu_gfl_deep.F90 + module_cu_gfl_sh.F90 ) list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_GFL_SOURCES PREPEND physics/physics_noaa/GFL/) @@ -222,13 +220,17 @@ else() endif() set(ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES - module_mp_tempo_main.F90 - module_mp_tempo_params.F90 - module_mp_tempo_utils.F90 - module_mp_tempo_ml.F90 - drivers/mpas/module_mp_tempo.F90 + src/module_mp_tempo_cfgs.F90 + src/module_mp_tempo_params.F90 + src/module_mp_tempo_ml.F90 + src/module_mp_tempo_utils.F90 + src/module_mp_tempo_diags.F90 + src/module_mp_tempo_aerosols.F90 + src/module_mp_tempo_main.F90 + src/module_mp_tempo_driver.F90 ) list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES PREPEND physics/physics_noaa/TEMPO/) +set_source_files_properties(physics/physics_noaa/TEMPO/src/module_mp_tempo_params.F90 PROPERTIES COMPILE_OPTIONS "-Dtempo_mpas") set(ATMOSPHERE_CORE_PHYSICS_MYNN-EDMF_DIR ${CMAKE_CURRENT_SOURCE_DIR}/physics/physics_noaa/MYNN-EDMF) @@ -253,6 +255,31 @@ set(ATMOSPHERE_CORE_PHYSICS_MYNN-EDMF_SOURCES ) list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_MYNN-EDMF_SOURCES PREPEND physics/physics_noaa/MYNN-EDMF/) +set(ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/physics/physics_noaa/MYNN-SFC) + +if(NOT EXISTS ${ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_DIR}) + set(PHYSICS_MYNN-SFC_REPO_URL "https://github.com/NCAR/MYNN-SFC.git") + execute_process(COMMAND git clone ${PHYSICS_MYNN-SFC_REPO_URL} ${ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_DIR} + RESULT_VARIABLE GIT_CLONE_RESULT + OUTPUT_VARIABLE GIT_CLONE_OUTPUT + ERROR_VARIABLE GIT_CLONE_ERROR) + if(NOT GIT_CLONE_RESULT EQUAL 0) + message(FATAL_ERROR "Git clone failed with error: ${GIT_CLONE_ERROR}") + endif() + +else() + message(STATUS "Directory ${DIR_TO_CHECK} already exists, skipping clone") +endif() + +set(ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_SOURCES + module_sf_mynnsfc_land.F90 + module_sf_mynnsfc_water.F90 + module_sf_mynnsfc_ice.F90 + MPAS/module_sf_mynnsfc_common.F90 + MPAS/module_sf_mynnsfc_driver.F90 +) +list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_SOURCES PREPEND physics/physics_noaa/MYNN-SFC/) + set(ATMOSPHERE_CORE_PHYSICS_RUCLSM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/physics/physics_noaa/RUCLSM) if(NOT EXISTS ${ATMOSPHERE_CORE_PHYSICS_RUCLSM_DIR}) @@ -494,6 +521,7 @@ add_library(core_atmosphere ${ATMOSPHERE_CORE_SOURCES} ${ATMOSPHERE_CORE_PHYSICS_UGWP_SOURCES} ${ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES} ${ATMOSPHERE_CORE_PHYSICS_MYNN-EDMF_SOURCES} + ${ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_SOURCES} ${ATMOSPHERE_CORE_PHYSICS_RUCLSM_SOURCES} ${ATMOSPHERE_CORE_PHYSICS_GFL_SOURCES} ${ATMOSPHERE_CORE_PHYSICS_SMOKE_SOURCES} diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index c327119e0a..9518eec2f9 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -421,9 +421,9 @@ - - - + + + @@ -2764,28 +2764,18 @@ description="configuration for cloud microphysics schemes" possible_values="`suite',`mp_wsm6',`mp_tempo',`mp_thompson',`mp_thompson_aerosols', `mp_kessler',`mp_nssl2m',`off'"/> - - - - - - - @@ -2859,6 +2849,16 @@ description="configuration for surface layer-scheme" possible_values="`suite',`sf_monin_obukhov','sf_monin_obukhov_rev',`sf_mynn',`sf_mynnsfclay',`sf_myj', `off'"/> + + + + @@ -2986,11 +2986,6 @@ description="configuration for spp boundary layer" possible_values="`0: off',`1: activated'"/> - - - - - - - diff --git a/src/core_atmosphere/mpas_atm_core.F b/src/core_atmosphere/mpas_atm_core.F index 6b8ec85d1a..4fa416778a 100644 --- a/src/core_atmosphere/mpas_atm_core.F +++ b/src/core_atmosphere/mpas_atm_core.F @@ -557,6 +557,7 @@ subroutine atm_mpas_init_block(dminfo, stream_manager, block, mesh, dt) uReconstructMeridional & ) + #ifdef DO_PHYSICS !proceed with initialization of physics parameterization if moist_physics is set to true: call mpas_pool_get_subpool(block % structs, 'sfc_input', sfc_input) @@ -588,10 +589,9 @@ subroutine atm_mpas_init_block(dminfo, stream_manager, block, mesh, dt) !initialization of all physics: call physics_init(dminfo, stream_manager, clock, block % configs, mesh, diag, tend, state, 1, & diag_physics, diag_physics_noahmp, ngw_input, atm_input, sfc_input, emission_input,output_noahmp) - call tempo_ml_init(block % configs) endif #endif - + call atm_compute_mesh_scaling(mesh, block % configs) call atm_compute_damping_coefs(mesh, block % configs) diff --git a/src/core_atmosphere/physics/.gitignore b/src/core_atmosphere/physics/.gitignore index 66bc08bd5e..81bff6cb48 100644 --- a/src/core_atmosphere/physics/.gitignore +++ b/src/core_atmosphere/physics/.gitignore @@ -1,5 +1,4 @@ *.f90 physics_wrf/*.f90 physics_wrf/files/ -physics_mmm UGWP diff --git a/src/core_atmosphere/physics/Makefile b/src/core_atmosphere/physics/Makefile index eb36d47b79..6739de6c94 100644 --- a/src/core_atmosphere/physics/Makefile +++ b/src/core_atmosphere/physics/Makefile @@ -6,7 +6,7 @@ endif all: ./../tools/manage_externals/checkout_externals --externals ./../Externals.cfg - $(MAKE) lookup_tables core_physics_init core_physics_mmm core_microphysics core_UGWP core_RUCLSM core_mynnedmf core_GFL core_SMOKE core_physics_wrf core_physics_noahmp core_physics + $(MAKE) lookup_tables core_physics_init core_physics_mmm core_microphysics core_UGWP core_RUCLSM core_mynnedmf core_mynnsfc core_GFL core_SMOKE core_physics_wrf core_physics_noahmp core_physics dummy: echo "****** compiling physics ******" @@ -65,7 +65,7 @@ core_physics_mmm: core_physics_init (cd physics_mmm; $(MAKE) -f Makefile.mpas all) core_microphysics: core_physics_init core_physics_mmm - (cd physics_noaa/TEMPO; cp ./drivers/mpas/module_mp_tempo.F90 .; $(MAKE) all COREDEF="$(COREDEF)") + (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas) core_SMOKE: core_physics_init (cd physics_noaa/SMOKE; cp ./MPAS/Makefile .; cp ./MPAS/mpas_smoke_wrapper.F90 .; $(MAKE) all) @@ -73,11 +73,14 @@ core_SMOKE: core_physics_init core_mynnedmf: core_physics_init core_physics_mmm (cd physics_noaa/MYNN-EDMF; cp ./MPAS/Makefile .; cp ./MPAS/module_bl_mynnedmf_driver.F90 .; cp ./MPAS/module_bl_mynnedmf_common.F90 .; $(MAKE) all) +core_mynnsfc: core_physics_init + (cd physics_noaa/MYNN-SFC; cp ./MPAS/Makefile .; cp ./MPAS/module_sf_mynnsfc_driver.F90 .; cp ./MPAS/module_sf_mynnsfc_common.F90 .; $(MAKE) all) + core_RUCLSM: core_physics_init core_physics_mmm (cd physics_noaa/RUCLSM; cp ./MPAS/Makefile .; cp ./MPAS/module_ruc_land.F90 .; cp ./MPAS/module_ruc_ice.F90 .; cp ./MPAS/module_sf_sfcdiags_ruclsm.F .; $(MAKE) all COREDEF="$(COREDEF)") core_GFL: core_physics_init core_physics_mmm - (cd physics_noaa/GFL; cp ./MPAS/Makefile .; cp ./MPAS/module_cu_gfl_mpas.F .; cp ./MPAS/module_cu_gfl_common.F .; $(MAKE) all) + (cd physics_noaa/GFL; cp ./MPAS/Makefile .; cp ./MPAS/module_cu_gfl_mpas.F90 .; cp ./MPAS/module_cu_gfl_common.F90 .; $(MAKE) all) core_UGWP: core_physics_init (cd physics_noaa/UGWP; $(MAKE) all) @@ -85,14 +88,14 @@ core_UGWP: core_physics_init core_physics_wrf: core_physics_init core_physics_mmm core_UGWP (cd physics_wrf; $(MAKE) all COREDEF="$(COREDEF)") -core_physics_noahmp: +core_physics_noahmp: core_physics_init (cd physics_noahmp/utility; $(MAKE) all COREDEF="$(COREDEF)") (cd physics_noahmp/src; $(MAKE) all COREDEF="$(COREDEF)") (cd physics_noahmp/drivers/mpas; $(MAKE) all COREDEF="$(COREDEF)") core_physics_init: $(OBJS_init) -core_physics: core_microphysics core_mynnedmf core_RUCLSM core_GFL core_SMOKE core_physics_wrf core_physics_noahmp +core_physics: core_microphysics core_mynnedmf core_mynnsfc core_RUCLSM core_GFL core_SMOKE core_physics_wrf core_physics_noahmp ($(MAKE) phys_interface COREDEF="$(COREDEF)") ar -ru libphys.a $(OBJS_init) $(OBJS) ($(MAKE) -C ./physics_mmm -f Makefile.mpas physics_mmm_lib) @@ -286,10 +289,11 @@ clean: ( cd physics_noahmp/drivers/mpas; $(MAKE) clean ) ( cd physics_noahmp/src; $(MAKE) clean ) ( cd physics_noahmp/utility; $(MAKE) clean ) - ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) clean; fi ) + ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas clean; fi ) ( if [ -d physics_noaa/UGWP ]; then cd physics_noaa/UGWP; $(MAKE) clean; fi ) ( if [ -d physics_noaa/RUCLSM ]; then cd physics_noaa/RUCLSM; $(MAKE) -f MPAS/Makefile clean; fi ) ( if [ -d physics_noaa/MYNN-EDMF ]; then cd physics_noaa/MYNN-EDMF; cp ./MPAS/Makefile .; $(MAKE) clean; fi ) + ( if [ -d physics_noaa/MYNN-SFC ]; then cd physics_noaa/MYNN-SFC; cp ./MPAS/Makefile .; $(MAKE) clean; fi ) ( if [ -d physics_noaa/GFL ]; then cd physics_noaa/GFL; cp ./MPAS/Makefile .; $(MAKE) clean; fi ) ( if [ -d physics_noaa/SMOKE ]; then cd physics_noaa/SMOKE; cp ./MPAS/Makefile .; $(MAKE) clean; fi ) @# Certain systems with intel compilers generate *.i files @@ -300,16 +304,16 @@ clean: $(RM) $@ $*.mod ifeq "$(GEN_F90)" "true" $(CPP) $(CPPFLAGS) $(COREDEF) $(HYDROSTATIC) $(CPPINCLUDES) $< > $*.f90 - $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../operators -I../../external/esmf_time_f90 + $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/MYNN-SFC -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90 -I../../operators else - $(FC) $(CPPFLAGS) $(COREDEF) $(HYDROSATIC) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../operators -I../../external/esmf_time_f90 + $(FC) $(CPPFLAGS) $(COREDEF) $(HYDROSATIC) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/MYNN-SFC -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90 -I../../operators endif .F90.o: $(RM) $@ $*.mod ifeq "$(GEN_F90)" "true" $(CPP) $(CPPFLAGS) $(COREDEF) $(HYDROSTATIC) $(CPPINCLUDES) $< > $*.f90 - $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../operators -I../../external/esmf_time_f90 + $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/MYNN-SFC -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90 -I../../operators else - $(FC) $(CPPFLAGS) $(COREDEF) $(HYDROSATIC) $(FFLAGS) -c $*.F90 $(CPPINCLUDES) $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../operators -I../../external/esmf_time_f90 + $(FC) $(CPPFLAGS) $(COREDEF) $(HYDROSATIC) $(FFLAGS) -c $*.F90 $(CPPINCLUDES) $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/MYNN-SFC -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90 -I../../operators endif diff --git a/src/core_atmosphere/physics/Registry_tempo.xml b/src/core_atmosphere/physics/Registry_tempo.xml new file mode 100644 index 0000000000..fa861d5d7c --- /dev/null +++ b/src/core_atmosphere/physics/Registry_tempo.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + diff --git a/src/core_atmosphere/physics/mpas_atmphys_control.F b/src/core_atmosphere/physics/mpas_atmphys_control.F index 7922727ed5..6c0b81327a 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_control.F +++ b/src/core_atmosphere/physics/mpas_atmphys_control.F @@ -462,7 +462,6 @@ subroutine physics_tables_init(dminfo,configs) !local variables: character(len=StrKIND),pointer:: config_microp_scheme - logical,pointer:: config_tempo_hailaware logical:: l_qr_acr_qg,l_qr_acr_qs,l_qi_aut_qs,l_freezeH2O !----------------------------------------------------------------------------------------------------------------- @@ -473,37 +472,8 @@ subroutine physics_tables_init(dminfo,configs) call mpas_pool_get_config(configs,'config_microp_scheme',config_microp_scheme) if(config_microp_scheme /= "mp_thompson" .or. & - config_microp_scheme /= "mp_tempo" .or. & config_microp_scheme /= "mp_thompson_aerosols") return - if (config_microp_scheme == "mp_tempo") then - l_qr_acr_qg = .false. - l_qr_acr_qs = .false. - l_qi_aut_qs = .false. - l_freezeH2O = .false. - - ! hailaware scheme needs hailaware table, non hailaware scheme can use either table - call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) - if (config_tempo_hailaware) then - inquire(file='MP_TEMPO_HAILAWARE_QRacrQG_DATA.DBL' ,exist=l_qr_acr_qg) - else - inquire(file='MP_TEMPO_HAILAWARE_QRacrQG_DATA.DBL' ,exist=l_qr_acr_qg) - if (.not. l_qr_acr_qg) then - inquire(file='MP_TEMPO_QRacrQG_DATA.DBL' ,exist=l_qr_acr_qg) - endif - endif - inquire(file='MP_TEMPO_QRacrQS_DATA.DBL' ,exist=l_qr_acr_qs) - inquire(file='MP_TEMPO_QIautQS_DATA.DBL' ,exist=l_qi_aut_qs) - inquire(file='MP_TEMPO_freezeH2O_DATA.DBL',exist=l_freezeH2O) - - if(.not. (l_qr_acr_qg .and. l_qr_acr_qs .and. l_qi_aut_qs .and. l_freezeH2O)) then - write(mpas_err_message,'(A)') & - '--- tables to run the TEMPO cloud microphysics do not exist: run build_tables_tempo first.' - call physics_error_fatal(mpas_err_message) - endif - ! call mpas_log_write('l_mp_tables = $l',logicArgs=(/l_mp_tables/)) - else - l_qr_acr_qg = .false. l_qr_acr_qs = .false. l_qi_aut_qs = .false. @@ -527,7 +497,6 @@ subroutine physics_tables_init(dminfo,configs) call physics_error_fatal(mpas_err_message) endif ! call mpas_log_write('l_mp_tables = $l',logicArgs=(/l_mp_tables/)) - endif endif diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index d78d56bec3..e657bdf561 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -21,8 +21,8 @@ module mpas_atmphys_driver_microphysics !wrf physics: use module_mp_kessler use module_mp_thompson - use module_mp_tempo,only: tempo_3d_to_1d_driver, tempo_init - ! use module_mp_tempo_utils + use module_mp_tempo_cfgs,only: ty_tempo_cfgs + use module_mp_tempo_driver,only: tempo_init,tempo_run,ty_tempo_driver_diags,tempo_aerosol_surface_emissions use module_mp_wsm6,only: wsm6 use mp_wsm6,only: mp_wsm6_init,refl10cm_wsm6 use module_mp_nssl_2mom @@ -94,7 +94,7 @@ module mpas_atmphys_driver_microphysics !--- initialization option for WSM6 from WRF version 3.8.1. this option could also be set as a namelist parameter. integer,parameter:: hail_opt = 0 - + type(ty_tempo_cfgs) :: tempo_cfgs contains @@ -109,15 +109,15 @@ subroutine allocate_microphysics(configs) !local pointers: character(len=StrKIND),pointer:: microp_scheme character(len=StrKIND),pointer:: nssl_moments - logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware - logical,pointer:: config_tempo_ml_nc_pbl + logical,pointer:: config_tempo_aerosolaware,config_tempo_hailaware + logical,pointer:: config_tempo_ml_for_bl_nc !----------------------------------------------------------------------------------------------------------------- call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) - call mpas_pool_get_config(configs,'config_tempo_ml_nc_pbl',config_tempo_ml_nc_pbl) + call mpas_pool_get_config(configs,'config_tempo_ml_for_bl_nc',config_tempo_ml_for_bl_nc) !sounding variables: if(.not.allocated(rho_p) ) allocate(rho_p(ims:ime,kms:kme,jms:jme) ) @@ -206,8 +206,6 @@ subroutine allocate_microphysics(configs) microp2a_select: select case(trim(microp_scheme)) case("mp_tempo") -! if(.not.allocated(ntc_p)) allocate(ntc_p(ims:ime,jms:jme)) -! if(.not.allocated(muc_p)) allocate(muc_p(ims:ime,jms:jme)) if(.not.allocated(ni_p) ) allocate(ni_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(nr_p) ) allocate(nr_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(refl10cm_p) ) allocate(refl10cm_p(ims:ime,kms:kme,jms:jme) ) @@ -216,26 +214,24 @@ subroutine allocate_microphysics(configs) if(.not.allocated(max_hail_diameter_sfc_p) ) allocate(max_hail_diameter_sfc_p(ims:ime,jms:jme) ) if(.not.allocated(max_hail_diameter_column_p) ) allocate(max_hail_diameter_column_p(ims:ime,jms:jme) ) - ! Allocate TEMPO options based on config flags insead of adding more nested select cases - ! These flags are associated with appropriate packages in mpas_atmphys_packages.F + if (config_tempo_aerosolaware) then + if(.not.allocated(nifa2d_p)) allocate(nifa2d_p(ims:ime,jms:jme)) + if(.not.allocated(nwfa2d_p)) allocate(nwfa2d_p(ims:ime,jms:jme)) + if(.not.allocated(nc_p) ) allocate(nc_p(ims:ime,kms:kme,jms:jme) ) + if(.not.allocated(nifa_p) ) allocate(nifa_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(nwfa_p) ) allocate(nwfa_p(ims:ime,kms:kme,jms:jme)) + endif + if (config_tempo_hailaware) then if(.not.allocated(ng_p) ) allocate(ng_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(volg_p)) allocate(volg_p(ims:ime,kms:kme,jms:jme)) endif - if (config_tempo_ml_nc_pbl) then + if (config_tempo_ml_for_bl_nc) then if(.not.allocated(cldfrac_p) ) allocate(cldfrac_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(qcbl_p) ) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) endif - if (config_tempo_aerosolaware) then - if(.not.allocated(nifa2d_p)) allocate(nifa2d_p(ims:ime,jms:jme)) - if(.not.allocated(nwfa2d_p)) allocate(nwfa2d_p(ims:ime,jms:jme)) - if(.not.allocated(nc_p) ) allocate(nc_p(ims:ime,kms:kme,jms:jme) ) - if(.not.allocated(nifa_p) ) allocate(nifa_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(nwfa_p) ) allocate(nwfa_p(ims:ime,kms:kme,jms:jme)) - endif - case("mp_nssl2m") if(.not.allocated(qh_p) ) allocate(qh_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(nc_p) ) allocate(nc_p(ims:ime,kms:kme,jms:jme)) @@ -275,7 +271,7 @@ subroutine deallocate_microphysics(configs) character(len=StrKIND),pointer:: microp_scheme character(len=StrKIND),pointer:: nssl_moments logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware - logical,pointer:: config_tempo_ml_nc_pbl + logical,pointer:: config_tempo_ml_for_bl_nc !----------------------------------------------------------------------------------------------------------------- @@ -283,7 +279,7 @@ subroutine deallocate_microphysics(configs) call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) - call mpas_pool_get_config(configs,'config_tempo_ml_nc_pbl',config_tempo_ml_nc_pbl) + call mpas_pool_get_config(configs,'config_tempo_ml_for_bl_nc',config_tempo_ml_for_bl_nc) !sounding variables: if(allocated(rho_p) ) deallocate(rho_p ) @@ -372,8 +368,6 @@ subroutine deallocate_microphysics(configs) microp2a_select: select case(trim(microp_scheme)) case("mp_tempo") -! if(allocated(ntc_p)) deallocate(ntc_p) -! if(allocated(muc_p)) deallocate(muc_p) if(allocated(ni_p) ) deallocate(ni_p ) if(allocated(nr_p) ) deallocate(nr_p ) if(allocated(refl10cm_p) ) deallocate(refl10cm_p ) @@ -382,24 +376,24 @@ subroutine deallocate_microphysics(configs) if(allocated(max_hail_diameter_sfc_p) ) deallocate(max_hail_diameter_sfc_p) if(allocated(max_hail_diameter_column_p) ) deallocate(max_hail_diameter_column_p) + if (config_tempo_aerosolaware) then + if(allocated(nifa2d_p)) deallocate(nifa2d_p) + if(allocated(nwfa2d_p)) deallocate(nwfa2d_p) + if(allocated(nc_p) ) deallocate(nc_p ) + if(allocated(nifa_p) ) deallocate(nifa_p ) + if(allocated(nwfa_p) ) deallocate(nwfa_p ) + endif + if (config_tempo_hailaware) then if(allocated(ng_p) ) deallocate(ng_p ) if(allocated(volg_p) ) deallocate(volg_p ) endif - if (config_tempo_ml_nc_pbl) then + if (config_tempo_ml_for_bl_nc) then if(allocated(cldfrac_p) ) deallocate(cldfrac_p) if(allocated(qcbl_p) ) deallocate(qcbl_p) endif - if (config_tempo_aerosolaware) then - if(allocated(nifa2d_p)) deallocate(nifa2d_p) - if(allocated(nwfa2d_p)) deallocate(nwfa2d_p) - if(allocated(nc_p) ) deallocate(nc_p ) - if(allocated(nifa_p) ) deallocate(nifa_p ) - if(allocated(nwfa_p) ) deallocate(nwfa_p ) - endif - case("mp_nssl2m") if(allocated(qh_p) ) deallocate(qh_p ) if(allocated(nc_p) ) deallocate(nc_p ) @@ -449,7 +443,8 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p !local pointer: logical,pointer:: do_restart character(len=StrKIND),pointer:: microp_scheme - logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware + logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware, config_tempo_refl10cm_from_melting + logical,pointer:: config_tempo_ml_for_bl_nc character(len=StrKIND),pointer:: nssl_moments logical :: outputon = .false. @@ -469,6 +464,8 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) + call mpas_pool_get_config(configs,'config_tempo_ml_for_bl_nc',config_tempo_ml_for_bl_nc) + call mpas_pool_get_config(configs,'config_tempo_refl10cm_from_melting',config_tempo_refl10cm_from_melting) call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_config(configs,'config_do_restart' ,do_restart ) @@ -485,8 +482,10 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p end select microp2_select case("mp_tempo") - call tempo_init(l_mp_tables=l_mp_tables, & - hail_aware_flag=config_tempo_hailaware, aerosol_aware_flag=config_tempo_aerosolaware) + call tempo_init(aerosolaware_flag=config_tempo_aerosolaware, & + hailaware_flag=config_tempo_hailaware, & + refl10cm_from_melting_flag=config_tempo_refl10cm_from_melting, & + ml_for_bl_nc_flag=config_tempo_ml_for_bl_nc, tempo_cfgs=tempo_cfgs) if (config_tempo_aerosolaware) then call init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) @@ -532,13 +531,11 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten !local pointers: character(len=StrKIND),pointer:: microp_scheme - logical,pointer:: config_tempo_aerosolaware,config_tempo_hailaware character(len=StrKIND),pointer:: nssl_moments - integer :: tempo_options - !local variables and arrays: integer:: istep + integer:: i,j,k integer, pointer :: do_diag_dbz logical :: do_diag_dbz_flag @@ -546,6 +543,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten character(len=StrKIND):: errmsg integer:: errflg + type(ty_tempo_driver_diags) :: tempo_driver_diags !----------------------------------------------------------------------------------------------------------------- !call mpas_log_write('') !call mpas_log_write('---enter subroutine driver_microphysics:') @@ -555,8 +553,6 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten errflg = 0 call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) - call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) - call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_array(diag_physics,'do_diag_dbz',do_diag_dbz) @@ -594,112 +590,57 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten call mpas_timer_stop('mp_kessler') case ("mp_tempo") + if (allocated(nwfa_p) .and. allocated(nwfa2d_p)) then + call tempo_aerosol_surface_emissions(dt=dt_microp, nwfa=nwfa_p, nwfa2d=nwfa2d_p, & + ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, kts=kts) + endif + call mpas_timer_start('mp_tempo') - tempo_options = 0 - if (config_tempo_hailaware) tempo_options = tempo_options + 1 - if (config_tempo_aerosolaware) tempo_options = tempo_options + 1 istep = 1 do while (istep .le. n_microp) - - tempo_opts: select case(tempo_options) - case(0) - call tempo_3d_to_1d_driver( & - th = th_p , qv = qv_p , qc = qc_p , & - qr = qr_p , qi = qi_p , qs = qs_p , & - qg = qg_p , ni = ni_p , nr = nr_p , & - !! ng = ng_p , qb = volg_p , & - !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & - !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - pii = pi_p , p = pres_p , dz = dz_p , & - w = w_p , dt_in = dt_microp , itimestep = itimestep , & - rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & - snowncv = snowncv_p , graupelnc = graupelnc_p , graupelncv = graupelncv_p , & - sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , & - re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , & - has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , & - !! ntc = ntc_p , muc = muc_p , & - refl_10cm = refl10cm_p , frainnc = frainnc_p , & - ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , & - ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , & - its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte & - ) - case(1) - if (config_tempo_aerosolaware) then - call tempo_3d_to_1d_driver( & - th = th_p , qv = qv_p , qc = qc_p , & - qr = qr_p , qi = qi_p , qs = qs_p , & - qg = qg_p , ni = ni_p , nr = nr_p , & - !! ng = ng_p , qb = volg_p , & - nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & - nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - pii = pi_p , p = pres_p , dz = dz_p , & - w = w_p , dt_in = dt_microp , itimestep = itimestep , & - rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & - snowncv = snowncv_p , graupelnc = graupelnc_p , graupelncv = graupelncv_p , & - sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , & - re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , & - has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , & - !! ntc = ntc_p , muc = muc_p , & - refl_10cm = refl10cm_p , frainnc = frainnc_p , & - qcbl = qcbl_p , cldfrac = cldfrac_p , & - ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , & - ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , & - its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte & - ) - elseif (config_tempo_hailaware) then - call tempo_3d_to_1d_driver( & - th = th_p , qv = qv_p , qc = qc_p , & - qr = qr_p , qi = qi_p , qs = qs_p , & - qg = qg_p , ni = ni_p , nr = nr_p , & - ng = ng_p , qb = volg_p , & - !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & - !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - pii = pi_p , p = pres_p , dz = dz_p , & - w = w_p , dt_in = dt_microp , itimestep = itimestep , & - rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & - snowncv = snowncv_p , graupelnc = graupelnc_p , graupelncv = graupelncv_p , & - sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , & - re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , & - has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , & - !! ntc = ntc_p , muc = muc_p , & - refl_10cm = refl10cm_p , frainnc = frainnc_p , & - !! qcbl = qcbl_p , cldfrac = cldfrac_p , & - ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , & - ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , & - its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte & - ) - else - call physics_error_fatal('driver_microphysics(): TEMPO called with invalid options -- case 1') - endif - case(2) - call tempo_3d_to_1d_driver( & - th = th_p , qv = qv_p , qc = qc_p , & - qr = qr_p , qi = qi_p , qs = qs_p , & - qg = qg_p , ni = ni_p , nr = nr_p , & - ng = ng_p , qb = volg_p , & - nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & - nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - pii = pi_p , p = pres_p , dz = dz_p , & - w = w_p , dt_in = dt_microp , itimestep = itimestep , & - rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & - snowncv = snowncv_p , graupelnc = graupelnc_p , graupelncv = graupelncv_p , & - sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , & - re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , & - has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , & - !! ntc = ntc_p , muc = muc_p , & - refl_10cm = refl10cm_p , frainnc = frainnc_p , & - max_hail_diameter_sfc = max_hail_diameter_sfc_p , & - max_hail_diameter_column = max_hail_diameter_column_p , & - qcbl = qcbl_p , cldfrac = cldfrac_p , & - ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , & - ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , & - its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte & - ) - case default - call physics_error_fatal('driver_microphysics(): TEMPO called with invalid options -- case default') - end select tempo_opts - + call tempo_run(tempo_cfgs=tempo_cfgs, & + dt = dt_microp , itimestep = itimestep , & + th = th_p , qv = qv_p , qc = qc_p , & + qr = qr_p , qi = qi_p , qs = qs_p , & + qg = qg_p , ni = ni_p , nr = nr_p , & + ng = ng_p , qb = volg_p , w = w_p , & + nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & + pii = pi_p , p = pres_p , dz = dz_p , & + qc_bl = qcbl_p , qcfrac_bl = cldfrac_p , & + ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , & + ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , & + its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte , & + tempo_diags = tempo_driver_diags) + do j = jts, jte + do i = its, ite + ! precipitation variables are added in case of multiple calls when n_microp > 1 + snowncv_p(i,j) = snowncv_p(i,j) + tempo_driver_diags%ice_liquid_equiv_precip(i,j) + & + tempo_driver_diags%snow_liquid_equiv_precip(i,j) + snownc_p(i,j) = snownc_p(i,j) + tempo_driver_diags%ice_liquid_equiv_precip(i,j) + & + tempo_driver_diags%snow_liquid_equiv_precip(i,j) + graupelncv_p(i,j) = graupelncv_p(i,j) + tempo_driver_diags%graupel_liquid_equiv_precip(i,j) + graupelnc_p(i,j) = graupelnc_p(i,j) + tempo_driver_diags%graupel_liquid_equiv_precip(i,j) + rainncv_p(i,j) = rainncv_p(i,j) + tempo_driver_diags%rain_precip(i,j) + & + tempo_driver_diags%ice_liquid_equiv_precip(i,j) + & + tempo_driver_diags%snow_liquid_equiv_precip(i,j) + & + tempo_driver_diags%graupel_liquid_equiv_precip(i,j) + rainnc_p(i,j) = rainnc_p(i,j) + tempo_driver_diags%rain_precip(i,j) + & + tempo_driver_diags%ice_liquid_equiv_precip(i,j) + & + tempo_driver_diags%snow_liquid_equiv_precip(i,j) + & + tempo_driver_diags%graupel_liquid_equiv_precip(i,j) + sr_p(i,j) = tempo_driver_diags%frozen_fraction(i,j) + frainnc_p(i,j) = frainnc_p(i,j) + tempo_driver_diags%frz_rain_precip(i,j) + max_hail_diameter_sfc_p(i,j) = tempo_driver_diags%max_hail_diameter_sfc(i,j) + max_hail_diameter_column_p(i,j) = tempo_driver_diags%max_hail_diameter_column(i,j) + do k = kts, kte + refl10cm_p(i,k,j) = tempo_driver_diags%refl10cm(i,k,j) + recloud_p(i,k,j) = tempo_driver_diags%re_cloud(i,k,j) + reice_p(i,k,j) = tempo_driver_diags%re_ice(i,k,j) + resnow_p(i,k,j) = tempo_driver_diags%re_snow(i,k,j) + enddo + enddo + enddo istep = istep + 1 enddo call mpas_timer_stop('mp_tempo') diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_sfclayer.F b/src/core_atmosphere/physics/mpas_atmphys_driver_sfclayer.F index 7e9aa600d8..f8b026f1ea 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_sfclayer.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_sfclayer.F @@ -15,11 +15,10 @@ module mpas_atmphys_driver_sfclayer use mpas_atmphys_vars use module_sf_mynn,only: sfclay_mynn - use module_mynnsfclay_driver,only:mynnsfclay_driver + use module_sf_mynnsfc_driver,only: mynnsfc_driver,mynnsfc_init use module_sf_sfclay use module_sf_sfclayrev,only: sfclayrev use sf_mynn,only: sf_mynn_init - use module_mynnsfclay,only: mynnsfclay_init use sf_sfclayrev,only: sf_sfclayrev_init use module_sf_myjsfc @@ -678,7 +677,6 @@ subroutine sfclayer_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite) case("sf_mynnsfclay") !input variables: - call mpas_pool_get_array(diag_physics,'qcg' ,qcg ) call mpas_pool_get_array(sfc_input ,'snowh',snowh) !inout variables: call mpas_pool_get_array(diag_physics,'ch' ,ch ) @@ -688,7 +686,6 @@ subroutine sfclayer_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite) do i = its,ite !input variables: snowh_p(i,j) = snowh(i) - qcg_p(i,j) = qcg(i) !inout variables: ch_p(i,j) = ch(i) cqs_p(i,j) = cqs(i) @@ -1097,7 +1094,7 @@ subroutine init_sfclayer(configs,diag_physics,sfc_input) call sf_mynn_init(errmsg,errflg) case("sf_mynnsfclay") - call mynnsfclay_init(errmsg,errflg) + call mynnsfc_init(allowed_to_read,errmsg,errflg) case("sf_myj") call mpas_pool_get_config(configs,'config_do_restart' ,config_do_restart ) @@ -1164,6 +1161,8 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite logical,pointer:: config_do_restart,config_frac_seaice logical,pointer:: config_do_DAcycling character(len=StrKIND),pointer:: sfclayer_scheme + character(len=StrKIND),pointer:: lsm_scheme + integer,pointer:: sf_mynn_sfcflux_land,sf_mynn_sfcflux_water real(kind=RKIND),dimension(:),pointer:: areaCell !local variables: @@ -1390,32 +1389,33 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite case("sf_mynnsfclay") call mpas_timer_start('sf_mynnsfclay') - call mpas_log_write('--- enter subroutine mynnsfclay_driver:') - call mynnsfclay_driver( & - p3d = pres_hyd_p , pi3d = pi_p , psfcpa = psfc_p , & - th3d = th_p , t3d = t_p , u3d = u_p , & - v3d = v_p , qv3d = qv_p , qc3d = qc_p , & - rho3d = rho_p , dz8w = dz_p , cp = cp , & - g = gravity , rovcp = rcp , R = R_d , & - xlv = xlv , chs = chs_p , chs2 = chs2_p , & + call mpas_log_write('--- enter subroutine mynnsfc_driver:') + call mpas_pool_get_config(configs,'config_mynn_sfcflux_land' ,sf_mynn_sfcflux_land ) + call mpas_pool_get_config(configs,'config_mynn_sfcflux_water',sf_mynn_sfcflux_water) + call mpas_pool_get_config(configs,'config_lsm_scheme' ,lsm_scheme ) + call mynnsfc_driver( & + p3d = pres_hyd_p , th3d = th_p , t3d = t_p , & + u3d = u_p , v3d = v_p , qv3d = qv_p , & + rho3d = rho_p , dz8w = dz_p , & + chs = chs_p , chs2 = chs2_p , psfcpa = psfc_p , & cqs = cqs_p , cqs2 = cqs2_p , cpm = cpm_p , & - znt = znt_p , & + znt = znt_p , qgh = qgh_p , & ust = ust_p , pblh = hpbl_p , mavail = mavail_p , & - zol = zol_p , mol = mol_p , regime = regime_p , & + zol = zol_p , mol = mol_p , & psim = psim_p , psih = psih_p , xland = xland_p , & hfx = hfx_p , qfx = qfx_p , lh = lh_p , & tsk = tsk_p , flhc = flhc_p , flqc = flqc_p , & - qgh = qgh_p , qsfc = qsfc_p , rmol = rmol_p , & + qsfc = qsfc_p , rmol = rmol_p , & u10 = u10_p , v10 = v10_p , th2 = th2m_p , & t2 = t2m_p , q2 = q2_p , snowh = snowh_p , & gz1oz0 = gz1oz0_p , wspd = wspd_p , br = br_p , & - isfflx = isfflx , dx = dx_p , svp1 = svp1 , & - svp2 = svp2 , svp3 = svp3 , svpt0 = svpt0 , & - ep1 = ep_1 , ep2 = ep_2 , karman = karman , & + isfflx = isfflx , dx = dx_p , & ustm = ustm_p , ck = ck_p , cka = cka_p , & cd = cd_p , cda = cda_p , ch = ch_p , & - qcg = qcg_p , spp_pbl = spp_pbl , isftcflx = isftcflx , & - iz0tlnd = iz0tlnd , & + spp_pbl = spp_pbl , & + sf_mynn_sfcflux_land = sf_mynn_sfcflux_land , & + sf_mynn_sfcflux_water = sf_mynn_sfcflux_water , & + flagc_lsm = lsm_scheme , & itimestep= itimestep , initflag = initflag , & restart = config_do_restart , & cycling = config_do_DAcycling , & @@ -1426,31 +1426,29 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite ) if(config_frac_seaice) then - call mynnsfclay_driver( & - p3d = pres_hyd_p , pi3d = pi_p , psfcpa = psfc_p , & - th3d = th_p , t3d = t_p , u3d = u_p , & - v3d = v_p , qv3d = qv_p , qc3d = qc_p , & - rho3d = rho_p , dz8w = dz_p , cp = cp , & - g = gravity , rovcp = rcp , R = R_d , & - xlv = xlv , chs = chs_sea , chs2 = chs2_sea , & + call mynnsfc_driver( & + p3d = pres_hyd_p , th3d = th_p , t3d = t_p , & + u3d = u_p , v3d = v_p , qv3d = qv_p , & + rho3d = rho_p , dz8w = dz_p , & + chs = chs_sea , chs2 = chs2_sea , psfcpa = psfc_p , & cqs = cqs_sea , cqs2 = cqs2_sea , cpm = cpm_sea , & - znt = znt_sea , & + znt = znt_sea , qgh = qgh_sea , & ust = ust_sea , pblh = hpbl_p , mavail = mavail_sea , & - zol = zol_sea , mol = mol_sea , regime = regime_sea , & + zol = zol_sea , mol = mol_sea , & psim = psim_sea , psih = psih_sea , xland = xland_sea , & hfx = hfx_sea , qfx = qfx_sea , lh = lh_sea , & tsk = tsk_sea , flhc = flhc_sea , flqc = flqc_sea , & - qgh = qgh_sea , qsfc = qsfc_sea , rmol = rmol_sea , & + qsfc = qsfc_sea , rmol = rmol_sea , & u10 = u10_sea , v10 = v10_sea , th2 = th2m_sea , & t2 = t2m_sea , q2 = q2_sea , snowh = snowh_p , & gz1oz0 = gz1oz0_sea , wspd = wspd_sea , br = br_sea , & - isfflx = isfflx , dx = dx_p , svp1 = svp1 , & - svp2 = svp2 , svp3 = svp3 , svpt0 = svpt0 , & - ep1 = ep_1 , ep2 = ep_2 , karman = karman , & + isfflx = isfflx , dx = dx_p , & ustm = ustm_sea , ck = ck_sea , cka = cka_sea , & cd = cd_sea , cda = cda_sea , ch = ch_sea , & - qcg = qcg_p , spp_pbl = spp_pbl , isftcflx = isftcflx , & - iz0tlnd = iz0tlnd , & + spp_pbl = spp_pbl , & + sf_mynn_sfcflux_land = sf_mynn_sfcflux_land , & + sf_mynn_sfcflux_water = sf_mynn_sfcflux_water , & + flagc_lsm = lsm_scheme , & itimestep= itimestep , initflag = initflag , & restart = config_do_restart , & cycling = config_do_DAcycling , & diff --git a/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F b/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F index dac3b2d20a..743dee98d4 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F +++ b/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F @@ -15,102 +15,19 @@ module mpas_atmphys_init_tempo use mpas_pool_routines use mpas_atmphys_utilities - use module_mp_tempo_params, only: ntb_arc,ntb_arw,ntb_art,ntb_arr,ntb_ark,tnccn_act, & - naCCN1,naCCN0,naIN0,naIN1,nwfa_default,aero_max, & - nc_ml_input, nc_ml_nodes, nc_ml_output, & - nr_ml_input, nr_ml_nodes, nr_ml_output, & - nc_ml_trans_mean, nc_ml_trans_var, & - nc_ml_w00, nc_ml_w01, nc_ml_b00, nc_ml_b01 - use module_mp_tempo_ml, only: MLdata, tempo_save_or_read_ml_data + use module_mp_tempo_params, only: nwfa_default, aero_max, & + naCCN1,naCCN0,naIN0,naIN1 implicit none private - public:: init_tempo_aerosols_forMPAS, tempo_ml_init + public:: init_tempo_aerosols_forMPAS -!MPAS main initialization of the TEMPO parameterization of cloud microphysics with nucleation of cloud -!droplets based on distributions of CCNs and INs (aerosol-aware parameterization). +!MPAS initialization of aerosols for TEMPO parameterization. - contains !================================================================================================================= - subroutine tempo_ml_init(configs) -! Called once to initial data for tempo_ml -!================================================================================================================= - -!input arguments: -type(mpas_pool_type),intent(in):: configs - -!local variables and pointers: - type(MLdata), dimension(2) :: tempo_ml_data - logical,pointer:: config_tempo_ml_nc_pbl,config_tempo_ml_nc,config_tempo_ml_nr - - call mpas_pool_get_config(configs, 'config_tempo_ml_nc_pbl', config_tempo_ml_nc_pbl) - call mpas_pool_get_config(configs, 'config_tempo_ml_nc', config_tempo_ml_nc) - call mpas_pool_get_config(configs, 'config_tempo_ml_nr', config_tempo_ml_nr) - - if(.not. (config_tempo_ml_nc_pbl .or. config_tempo_ml_nc .or. config_tempo_ml_nr)) then - call mpas_log_write('--- All configuration flags for TEMPO ML are false... TEMPO ML will not be used') - return - endif - - if(config_tempo_ml_nc .or. config_tempo_ml_nr) then - call mpas_log_write('--- TEMPO ML for nc and nr prediction not yet working... These flags will be ignored') - endif - - if(config_tempo_ml_nc_pbl) then - call mpas_log_write('--- Using TEMPO ML prediction to give life to the PBL clouds') - endif - - ! Cloud water - tempo_ml_data(1)%input_size = nc_ml_input - tempo_ml_data(1)%node_size = nc_ml_nodes - tempo_ml_data(1)%output_size = nc_ml_output - - if (.not.allocated(tempo_ml_data(1)%transform_mean)) allocate(tempo_ml_data(1)%transform_mean(nc_ml_input)) - if (.not.allocated(tempo_ml_data(1)%transform_var)) allocate(tempo_ml_data(1)%transform_var(nc_ml_input)) - - tempo_ml_data(1)%transform_mean = nc_ml_trans_mean - tempo_ml_data(1)%transform_var = nc_ml_trans_var - - if (.not.allocated(tempo_ml_data(1)%weights00)) allocate(tempo_ml_data(1)%weights00(nc_ml_nodes,nc_ml_input)) - if (.not.allocated(tempo_ml_data(1)%weights01)) allocate(tempo_ml_data(1)%weights01(nc_ml_output,nc_ml_nodes)) - if (.not.allocated(tempo_ml_data(1)%bias00)) allocate(tempo_ml_data(1)%bias00(nc_ml_nodes)) - if (.not.allocated(tempo_ml_data(1)%bias01)) allocate(tempo_ml_data(1)%bias01(nc_ml_output)) - - tempo_ml_data(1)%weights00 = reshape(nc_ml_w00, (/nc_ml_nodes, nc_ml_input/)) - tempo_ml_data(1)%weights01 = reshape(nc_ml_w01, (/nc_ml_output, nc_ml_nodes/)) - tempo_ml_data(1)%bias00 = nc_ml_b00 - tempo_ml_data(1)%bias01 = nc_ml_b01 - - ! Rain water - tempo_ml_data(2)%input_size = nc_ml_input - tempo_ml_data(2)%node_size = nc_ml_nodes - tempo_ml_data(2)%output_size = nc_ml_output - - if (.not.allocated(tempo_ml_data(2)%transform_mean)) allocate(tempo_ml_data(2)%transform_mean(nc_ml_input)) - if (.not.allocated(tempo_ml_data(2)%transform_var)) allocate(tempo_ml_data(2)%transform_var(nc_ml_input)) - - tempo_ml_data(2)%transform_mean = nc_ml_trans_mean - tempo_ml_data(2)%transform_var = nc_ml_trans_var - - if (.not.allocated(tempo_ml_data(2)%weights00)) allocate(tempo_ml_data(2)%weights00(nc_ml_nodes,nc_ml_input)) - if (.not.allocated(tempo_ml_data(2)%weights01)) allocate(tempo_ml_data(2)%weights01(nc_ml_output,nc_ml_nodes)) - if (.not.allocated(tempo_ml_data(2)%bias00)) allocate(tempo_ml_data(2)%bias00(nc_ml_nodes)) - if (.not.allocated(tempo_ml_data(2)%bias01)) allocate(tempo_ml_data(2)%bias01(nc_ml_output)) - - tempo_ml_data(2)%weights00 = reshape(nc_ml_w00, (/nc_ml_nodes, nc_ml_input/)) - tempo_ml_data(2)%weights01 = reshape(nc_ml_w01, (/nc_ml_output, nc_ml_nodes/)) - tempo_ml_data(2)%bias00 = nc_ml_b00 - tempo_ml_data(2)%bias01 = nc_ml_b01 - - ! Save neural network - call tempo_save_or_read_ml_data(ml_data_in=tempo_ml_data) - - end subroutine tempo_ml_init - -!================================================================================================================= - subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) +subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) !================================================================================================================= !input variables: @@ -148,11 +65,6 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia !----------------------------------------------------------------------------------------------------------------- !call mpas_log_write('--- enter subroutine init_tempo_aerosols_forMPAS:') -!... read a static file containing CCN activation of aerosols. The data were created from a parcel model by -!... Feingold & Heymsfield with further changes by Eidhammer and Kriedenweis. - call table_ccnAct(dminfo) - call mpas_log_write('--- end read table_ccnAct:') - !... if do_restart is true, then we do not need to check the initialization of nwfa, nifa, and nwfa2d. If false, ! then, we proceed with the initialization: if(do_restart) return @@ -275,65 +187,6 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia end subroutine init_tempo_aerosols_forMPAS -!================================================================================================================= - subroutine table_ccnAct(dminfo) -!================================================================================================================= - -!input variables: - type(dm_info),intent(in):: dminfo - -!local variables: - logical:: opened - integer:: ccn_unit,i,istat - character(len=StrKIND):: errmess -!----------------------------------------------------------------------------------------------------------------- - - if(.not.allocated(tnccn_act)) allocate(tnccn_act(ntb_arc,ntb_arw,ntb_art,ntb_arr,ntb_ark)) - -!get a unit to open binary file: - istat = -999 - if(dminfo % my_proc_id == IO_NODE) then - do i = 10,99 - inquire(i,opened = opened,iostat=istat) - if(.not. opened ) then - ccn_unit = i - exit - endif - enddo - if(istat /= 0) & - call physics_error_fatal('mpas_atmphys_init_microphysics table_ccnAct: Can not '// & - 'find unused fortran unit to read in lookup table.' ) - endif - -!distribute unit to other processors: - call mpas_dmpar_bcast_int(dminfo,ccn_unit) - -!open binary file: - istat = -999 - if(dminfo % my_proc_id == IO_NODE) then - open(ccn_unit,file='CCN_ACTIVATE_DATA',form='UNFORMATTED',status='OLD',iostat=istat) - if(istat /= 0) then - write(errmess,'(A,I4)') 'mpas_atmphys_init_microphysics table_ccnAct:: '// & - 'error opening CCN_ACTIVATE_DATA on unit', ccn_unit - call physics_error_fatal(errmess) - endif - endif - -!read and broadcast data to all nodes: - istat = -999 - if(dminfo % my_proc_id == IO_NODE) then - read(ccn_unit,iostat=istat) tnccn_act - if(istat /= 0) then - write(errmess,'(A,I4)') 'mpas_atmphys_init_microphysics table_ccnAct:: '// & - 'error reading tnccn_act on unit', ccn_unit - call physics_error_fatal(errmess) - endif - endif - - DM_BCAST_MACRO(tnccn_act) - - end subroutine table_ccnAct - -!================================================================================================================= + !================================================================================================================= end module mpas_atmphys_init_tempo -!================================================================================================================= +!================================================================================================================= \ No newline at end of file diff --git a/src/core_atmosphere/physics/mpas_atmphys_interface.F b/src/core_atmosphere/physics/mpas_atmphys_interface.F index 35d577efab..4faa5fbe38 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_interface.F +++ b/src/core_atmosphere/physics/mpas_atmphys_interface.F @@ -663,8 +663,8 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, real(kind=RKIND),dimension(:),pointer :: nifa2d,nwfa2d,nt_c,mu_c !TEMPO/NSSL character(len=StrKIND),pointer:: nssl_moments - logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware - logical,pointer:: config_tempo_ml_nc_pbl + logical,pointer:: config_tempo_aerosolaware,config_tempo_hailaware + logical,pointer:: config_tempo_ml_for_bl_nc integer,pointer:: index_qh integer,pointer:: index_zrw,index_zgw,index_zhw integer,pointer:: index_ns,index_ng,index_nh,index_nccn @@ -696,7 +696,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) - call mpas_pool_get_config(configs,'config_tempo_ml_nc_pbl',config_tempo_ml_nc_pbl) + call mpas_pool_get_config(configs,'config_tempo_ml_for_bl_nc',config_tempo_ml_for_bl_nc) call mpas_pool_get_array(mesh,'zgrid',zgrid) call mpas_pool_get_array(mesh,'zz' ,zz ) @@ -888,7 +888,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, enddo enddo - if(config_tempo_ml_nc_pbl) then + if(config_tempo_ml_for_bl_nc) then call mpas_pool_get_array(diag_physics,'qc_bl',qc_bl) call mpas_pool_get_array(diag_physics,'cldfrac_bl',cldfrac_bl) do j = jts, jte diff --git a/src/core_atmosphere/physics/mpas_atmphys_packages.F b/src/core_atmosphere/physics/mpas_atmphys_packages.F index 90c346261b..8241da7344 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_packages.F +++ b/src/core_atmosphere/physics/mpas_atmphys_packages.F @@ -47,11 +47,10 @@ function atmphys_setup_packages(configs,streamInfo,packages,iocontext) result(ie character(len=StrKIND),pointer:: config_volc_scheme character(len=StrKIND),pointer:: config_sna_scheme character(len=StrKIND),pointer:: config_methane_scheme - - logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware + logical,pointer:: config_tempo_aerosolaware,config_tempo_hailaware logical,pointer:: mp_kessler_in,mp_thompson_in,mp_thompson_aers_in,mp_wsm6_in,mp_nssl2m_in,nssl3m_in - logical,pointer:: mp_tempo_in, tempo_hailaware_in, tempo_aerosolaware_in - logical,pointer:: cu_grell_freitas_in,cu_kain_fritsch_in,cu_ntiedtke_in + logical,pointer:: mp_tempo_in,tempo_hailaware_in,tempo_aerosolaware_in + logical,pointer:: cu_grell_freitas_in,cu_grell_freitas_li_in,cu_kain_fritsch_in,cu_ntiedtke_in logical,pointer:: bl_mynn_in,bl_mynnedmf_in,bl_ysu_in,bl_myj_in logical,pointer:: lsm_noah_in,lsm_ruc_in logical,pointer:: sf_noahmp_in @@ -76,8 +75,8 @@ function atmphys_setup_packages(configs,streamInfo,packages,iocontext) result(ie call mpas_pool_get_config(configs,'config_microp_scheme',config_microp_scheme) call mpas_pool_get_config(configs,'config_nssl_moments',config_nssl_moments) - call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) + call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) nullify(mp_kessler_in) call mpas_pool_get_package(packages,'mp_kessler_inActive',mp_kessler_in) @@ -139,12 +138,8 @@ function atmphys_setup_packages(configs,streamInfo,packages,iocontext) result(ie mp_wsm6_in = .true. elseif(config_microp_scheme == 'mp_tempo') then mp_tempo_in = .true. - if (config_tempo_aerosolaware) then - tempo_aerosolaware_in = .true. - endif - if (config_tempo_hailaware) then - tempo_hailaware_in = .true. - endif + if (config_tempo_aerosolaware) tempo_aerosolaware_in = .true. + if (config_tempo_hailaware) tempo_hailaware_in = .true. elseif(config_microp_scheme == 'mp_nssl2m') then mp_nssl2m_in = .true. IF ( config_nssl_moments == 'nssl3m' ) THEN diff --git a/src/core_atmosphere/physics/mpas_atmphys_todynamics.F b/src/core_atmosphere/physics/mpas_atmphys_todynamics.F index 4cc141bca5..155bbbaab6 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_todynamics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_todynamics.F @@ -89,7 +89,7 @@ subroutine physics_get_tend(block,mesh,state,diag,tend,tend_physics,configs,rk_s radt_lw_scheme, & radt_sw_scheme - logical,pointer::tempo_aerosolaware + logical,pointer::config_tempo_aerosolaware integer:: i,iCell,k,n integer,pointer:: index_qv,index_qc,index_qr,index_qi,index_qs integer,pointer:: index_nc,index_ni,index_nifa,index_nwfa @@ -127,7 +127,7 @@ subroutine physics_get_tend(block,mesh,state,diag,tend,tend_physics,configs,rk_s call mpas_pool_get_config(configs,'config_pbl_scheme' ,pbl_scheme ) call mpas_pool_get_config(configs,'config_radt_lw_scheme' ,radt_lw_scheme ) call mpas_pool_get_config(configs,'config_radt_sw_scheme' ,radt_sw_scheme ) - call mpas_pool_get_config(configs,'config_tempo_aerosolaware',tempo_aerosolaware) + call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) call mpas_pool_get_array(state,'theta_m' ,theta_m,1) call mpas_pool_get_array(state,'scalars' ,scalars,1) @@ -211,7 +211,7 @@ subroutine physics_get_tend(block,mesh,state,diag,tend,tend_physics,configs,rk_s call physics_get_tend_work( & block,mesh,nCells,nEdges,nCellsSolve,nEdgesSolve,rk_step,dynamics_substep, & pbl_scheme,convection_scheme,microp_scheme,radt_lw_scheme,radt_sw_scheme, & - tempo_aerosolaware,index_qv,index_qc,index_qr,index_qi,index_qs, & + config_tempo_aerosolaware,index_qv,index_qc,index_qr,index_qi,index_qs, & index_nc,index_ni,index_nifa,index_nwfa, & mass,mass_edge,theta_m,scalars, & rublten,rvblten,rthblten,rqvblten,rqcblten,rqiblten,rqsblten, & @@ -251,7 +251,7 @@ end subroutine physics_get_tend subroutine physics_get_tend_work( & block,mesh,nCells,nEdges,nCellsSolve,nEdgesSolve,rk_step,dynamics_substep, & pbl_scheme,convection_scheme,microp_scheme,radt_lw_scheme,radt_sw_scheme, & - tempo_aerosolaware,index_qv,index_qc,index_qr,index_qi,index_qs, & + config_tempo_aerosolaware,index_qv,index_qc,index_qr,index_qi,index_qs, & index_nc,index_ni,index_nifa,index_nwfa, & mass,mass_edge,theta_m,scalars, & rublten,rvblten,rthblten,rqvblten,rqcblten,rqiblten,rqsblten, & @@ -273,7 +273,7 @@ subroutine physics_get_tend_work( & character(len=StrKIND),intent(in):: pbl_scheme character(len=StrKIND),intent(in):: radt_lw_scheme character(len=StrKIND),intent(in):: radt_sw_scheme - logical,intent(in):: tempo_aerosolaware + logical,intent(in):: config_tempo_aerosolaware integer,intent(in):: nCells,nEdges,nCellsSolve,nEdgesSolve integer,intent(in):: rk_step,dynamics_substep @@ -369,7 +369,7 @@ subroutine physics_get_tend_work( & enddo endif - if((trim(microp_scheme) == 'mp_tempo') .and. (tempo_aerosolaware)) then + if((trim(microp_scheme) == 'mp_tempo') .and. (config_tempo_aerosolaware)) then do i = 1, nCellsSolve do k = 1, nVertLevels tend_scalars(index_nc,k,i) = tend_scalars(index_nc,k,i) + rncblten(k,i)*mass(k,i) @@ -397,7 +397,7 @@ subroutine physics_get_tend_work( & enddo endif - if((trim(microp_scheme) == 'mp_tempo') .and. (tempo_aerosolaware)) then + if((trim(microp_scheme) == 'mp_tempo') .and. (config_tempo_aerosolaware)) then do i = 1, nCellsSolve do k = 1, nVertLevels tend_scalars(index_nc,k,i) = tend_scalars(index_nc,k,i) + rncblten(k,i)*mass(k,i) diff --git a/src/core_atmosphere/physics/mpas_atmphys_vars.F b/src/core_atmosphere/physics/mpas_atmphys_vars.F index e26837bc1a..8809af3544 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_vars.F +++ b/src/core_atmosphere/physics/mpas_atmphys_vars.F @@ -763,7 +763,7 @@ module mpas_atmphys_vars lakedepth_p, &!depth of lakes needed to run the lake model physics. lakemask_p !mask needed to detect the location of lakes to run the lake model physics. -!... arrays only in mynn surface layer scheme (module_sf_mynn.F): +!... arrays only in mynn surface layer scheme (module_sf_mynn.F): (note qcg is not needed for mynn sfclayer submodule) real(kind=RKIND),dimension(:,:),allocatable:: & ch_p, &!surface exchange coeff for heat [m/s] qcg_p !cloud water mixing ratio at the ground surface [kg/kg] diff --git a/src/core_atmosphere/physics/physics_mmm b/src/core_atmosphere/physics/physics_mmm new file mode 160000 index 0000000000..a4baf7f324 --- /dev/null +++ b/src/core_atmosphere/physics/physics_mmm @@ -0,0 +1 @@ +Subproject commit a4baf7f3243d1db0dbc5f63473f895bdbdc05c30 diff --git a/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF b/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF index 6d1c73ac45..c942418a47 160000 --- a/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF +++ b/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF @@ -1 +1 @@ -Subproject commit 6d1c73ac457f16e31fd0a9bb22a58d602f43cc57 +Subproject commit c942418a47a29dee09b51b377286da6bb25160e3 diff --git a/src/core_atmosphere/physics/physics_noaa/MYNN-SFC b/src/core_atmosphere/physics/physics_noaa/MYNN-SFC new file mode 160000 index 0000000000..9af3bb9ac3 --- /dev/null +++ b/src/core_atmosphere/physics/physics_noaa/MYNN-SFC @@ -0,0 +1 @@ +Subproject commit 9af3bb9ac3bc2bc7d61a22d0483e7090183dfe8a diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index f325c9d778..9adf9ef282 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit f325c9d778ca34ecb781ed92757791749a373a52 +Subproject commit 9adf9ef2827104640125f0c322e1218fce74e94c diff --git a/src/core_atmosphere/physics/physics_wrf/Makefile b/src/core_atmosphere/physics/physics_wrf/Makefile index d8e17263d2..0f39483dbe 100644 --- a/src/core_atmosphere/physics/physics_wrf/Makefile +++ b/src/core_atmosphere/physics/physics_wrf/Makefile @@ -52,9 +52,6 @@ OBJS = \ module_sf_urban.o \ bl_mynn_post.o \ bl_mynn_pre.o \ - module_mynnsfclay.o \ - module_mynnsfclay_pre.o \ - module_mynnsfclay_driver.o \ cu_ntiedtke_post.o \ cu_ntiedtke_pre.o \ sf_mynn_pre.o \ @@ -71,10 +68,6 @@ module_bl_mynn.o: \ bl_mynn_post.o \ bl_mynn_pre.o -module_mynnsfclay_driver.o: \ - module_mynnsfclay.o \ - module_mynnsfclay_pre.o - module_cam_support.o: \ module_cam_shr_kind_mod.o diff --git a/src/core_atmosphere/physics/physics_wrf/module_mynnsfclay.F90 b/src/core_atmosphere/physics/physics_wrf/module_mynnsfclay.F90 deleted file mode 100644 index 60d3c67686..0000000000 --- a/src/core_atmosphere/physics/physics_wrf/module_mynnsfclay.F90 +++ /dev/null @@ -1,2279 +0,0 @@ -!================================================================================================================= - module module_mynnsfclay - -!------------------------------------------------------------------- -!Modifications implemented by Joseph Olson NOAA/GSL -!The following overviews the current state of this scheme:: -! -! BOTH LAND AND WATER: -!1) Calculation of stability parameter (z/L) taken from Li et al. (2010 BLM) -! for first iteration of first time step; afterwards, exact calculation -! using a brute force iterative method described in Olson et al. (2021 NOAA -! Tech memorandum). This method replaces the iterative technique used in -! module_sf_sfclayrev.F (Jimenez et al. 2013) with mods. Either technique -! gives about the same result. The former technique is retained in this -! module (commented out) for potential subsequent benchmarking. -!2) Fixed isflux=0 option to turn off scalar fluxes, but keep momentum -! fluxes for idealized studies (credit: Anna Fitch). -!3) Kinematic viscosity varies with temperature according to Andreas (1989). -!4) Uses the blended Monin-Obukhov flux-profile relationships COARE (Fairall -! et al 2003) for the unstable regime (a blended mix of Dyer-Hicks 1974 and -! Grachev et al (2000). Uses Cheng and Brutsaert (2005) for stable conditions. -!5) The following overviews the namelist variables that control the -! aerodynamic roughness lengths (over water) and the thermal and moisture -! roughness lengths (defaults are recommended): -! -! LAND only: -! "iz0tlnd" namelist option is used to select the following options: -! (default) =0: Zilitinkevich (1995); Czil now set to 0.095 -! =1: Czil_new (modified according to Chen & Zhang 2008) -! =2: Modified Yang et al (2002, 2008) - generalized for all landuse -! =3: constant zt = z0/7.4 (original form; Garratt 1992) -! -! WATER only: -! "isftcflx" namelist option is used to select the following options: -! (default) =0: z0, zt, and zq from the COARE algorithm. Set COARE_OPT (below) to -! 3.0 (Fairall et al. 2003, default) -! 3.5 (Edson et al 2013) - now with bug fix (Edson et al. 2014, JPO) -! =1: z0 from Davis et al (2008), zt & zq from COARE 3.0/3.5 -! =2: z0 from Davis et al (2008), zt & zq from Garratt (1992) -! =3: z0 from Taylor and Yelland (2004), zt and zq from COARE 3.0/3.5 -! -! SNOW/ICE only: -! Andreas (2002) snow/ice parameterization for thermal and -! moisture roughness is used over all gridpoints with snow deeper than -! 0.1 m. This algorithm calculates a z0 for snow (Andreas et al. 2005, BLM), -! which is only used as part of the thermal and moisture roughness -! length calculation, not to directly impact the surface winds. -! -! Misc: -!1) Added a more elaborate diagnostic for u10 & V10 for high vertical resolution -! model configurations but for most model configurations with depth of -! the lowest half-model level near 10 m, a neutral-log diagnostic is used. -! -!2) Option to activate stochastic parameter perturbations (SPP), which -! perturb z0, zt, and zq, along with many other parameters in the MYNN- -! EDMF scheme. -! -!NOTE: This code was primarily tested in combination with the RUC LSM. -! Performance with the Noah (or other) LSM is relatively unknown. -!------------------------------------------------------------------- - use ccpp_kind_types,only: kind_phys -! use mynn_shared,only: esat_blend,qsat_blend,xl_blend - - implicit none - private - public:: mynnsfclay, & - mynnsfclay_init, & - mynnsfclay_finalize - - - logical,parameter:: debug_code = .false. - integer,parameter:: psi_opt = 0 ! 0 = stable: Cheng and Brustaert - ! unstable: blended COARE - ! 1 = GFS - real,parameter:: wmin = 0.1 - real,parameter:: vconvc = 1.25 - real,parameter:: snowz0 = 0.011 - real,parameter:: coare_opt = 3.5 ! 3.0 or 3.5 - !For debugging purposes: - - real,dimension(0:1000),save:: psim_stab,psim_unstab, & - psih_stab,psih_unstab - - - contains - - -!================================================================================================================= -!>\section arg_table_sf_mynn_init -!!\html\include sf_mynn_init.html -!! - subroutine mynnsfclay_init(errmsg,errflg) -!================================================================================================================= - -!--- output arguments: - character(len=*),intent(out):: errmsg - integer,intent(out):: errflg - -!----------------------------------------------------------------------------------------------------------------- - - call psi_init(psi_opt) - - errmsg = ' ' - errflg = 0 - - end subroutine mynnsfclay_init - -!================================================================================================================= -!>\section arg_table_sf_mynn_finalize -!!\html\include sf_mynn_finalize.html -!! - subroutine mynnsfclay_finalize(errmsg,errflg) -!================================================================================================================= - -!--- output arguments: - character(len=*),intent(out):: errmsg - integer,intent(out):: errflg - -!----------------------------------------------------------------------------------------------------------------- - - errmsg = ' ' - errflg = 0 - - end subroutine mynnsfclay_finalize - -!================================================================================================================= -!>\section arg_table_sf_mynn_run -!!\html\include sf_mynn_run.html -!! - subroutine mynnsfclay( & - u1d,v1d,t1d,qv1d,p1d,dz8w1d,rho1d, & - u1d2,v1d2,dz2w1d,cp,g,rovcp,r,xlv, & - psfcpa,chs,chs2,cqs,cqs2, & - cpm,pblh,rmol, & - znt,ust,mavail,zol,mol,regime,psim, & - psih,xland,hfx,qfx,tsk,u10,v10,th2, & - t2,q2,flhc,flqc,snowh,qgh,qsfc,lh, & - gz1oz0,wspd,br,isfflx,dx,svp1,svp2, & - svp3,svpt0,ep1,ep2,karman,ch,qcg, & - itimestep,wstar,qstar,ustm,ck,cka, & - cd,cda,spp_pbl,rstoch1d,isftcflx, & - iz0tlnd,its,ite,restart_or_cycle, & - errmsg,errflg & - ) - implicit none -!================================================================================================================= - -!----------------------------- -! scalars: -!----------------------------- - integer,intent(in):: its,ite - integer,intent(in):: itimestep - - real(kind=kind_phys),intent(in):: svp1,svp2,svp3,svpt0,ep1,ep2 - real(kind=kind_phys),intent(in):: karman,cp,g,rovcp,r,xlv - - real(kind=kind_phys),parameter:: prt=1. !prandlt number - real(kind=kind_phys),parameter:: xka=2.4e-5 !molecular diffusivity - - character(len=*),intent(out):: errmsg - integer,intent(out):: errflg - -!----------------------------- -! namelist options -!----------------------------- - logical,intent(in):: spp_pbl,restart_or_cycle - - integer,intent(in):: isfflx - integer,intent(in),optional:: isftcflx,iz0tlnd - -!----------------------------- -! 1d arrays -!----------------------------- - real(kind=kind_phys),intent(in),dimension(its:ite):: mavail, & - pblh, & - xland, & - tsk, & - psfcpa, & - qcg, & - snowh, & - dx - - real(kind=kind_phys),intent(in),dimension(its:ite):: u1d, & - v1d, & - u1d2, & - v1d2, & - qv1d, & - p1d, & - t1d, & - dz8w1d, & - dz2w1d, & - rho1d - real(kind=kind_phys),intent(in),dimension(its:ite):: & - rstoch1d - - - real(kind=kind_phys),intent(inout),dimension(its:ite):: & - regime, & - hfx, & - qfx, & - lh, & - mol, & - rmol, & - qgh, & - qsfc, & - znt, & - zol, & - ust, & - cpm, & - chs2, & - cqs2, & - cqs, & - chs, & - ch, & - flhc, & - flqc, & - gz1oz0, & - wspd, & - br, & - psim, & - psih - -!----------------------------- -! diagnostic outputs: -!----------------------------- - real(kind=kind_phys),intent(out),dimension(its:ite):: & - u10, & - v10, & - th2, & - t2, & - q2 - - real(kind=kind_phys),intent(out),dimension(its:ite):: & - wstar, & - qstar - - real(kind=kind_phys),intent(out),dimension(its:ite),optional:: & - ck, & - cka, & - cd, & - cda, & - ustm - -!----------------------------- -! local variables -!----------------------------- - integer:: n,i,k,l,yesno - - real(kind=kind_phys):: ep3 - real(kind=kind_phys):: pl,thcon,tvcon,e1 - real(kind=kind_phys):: dthvdz,dthvm,vconv,zol2,zol10,zolza,zolz0,zolzt - real(kind=kind_phys):: dtg,psix,dtthx,dthdz,psix10,psit,psit2, & - psiq,psiq2,psiq10,dzdt,psix_min - real(kind=kind_phys):: fluxc,vsgd - real(kind=kind_phys):: restar,visc,dqg,oldust,oldtst - - real(kind=kind_phys),dimension(its:ite) :: & - za, & !height of lowest 1/2 sigma level(m) - za2, & !height of 2nd lowest 1/2 sigma level(m) - thv1d, & !theta-v at lowest 1/2 sigma (K) - th1d, & !theta at lowest 1/2 sigma (K) - tc1d, & !t at lowest 1/2 sigma (Celsius) - tv1d, & !tv at lowest 1/2 sigma (K) - qvsh, & !qv at lowest 1/2 sigma (spec humidity) - psih2, & !m-o stability functions at z=2 m - psim10, & !m-o stability functions at z=10 m - psih10, & !m-o stability functions at z=10 m - wspdi, & - z_q, & !moisture roughness length - z_t, & !thermalroughness length - ZNTstoch, & - govrth, & !g/theta - thgb, & !theta at ground - thvgb, & !theta-v at ground - psfc, & !press at surface (Pa/1000) - qsfcmr, & !qv at surface (mixing ratio, kg/kg) - gz2oz0, & !log((2.0+znt(i))/znt(i)) - gz10oz0, & !log((10.+znt(i))/znt(i)) - gz2ozt, & !log((2.0+z_t(i))/z_t(i)) - gz10ozt, & !log((10.+z_t(i))/z_t(i)) - gz1ozt, & !log((za(i)+z_t(i))/z_t(i)) - zratio !z0/zt - -!----------------------------------------------------------------------------------------------------------------- - - ep3 = 1.-ep2 - if (itimestep == 1) then - if (debug_code) then - print*,"======= printing of constants:" - print*,"cp=", cp," g=", g - print*,"Rd=", R," ep1=", ep1 - print*,"xlv=", XLV," karman=", karman - print*,"ep2=", ep2," ep3=", ep3 - endif - endif - - do i=its,ite - !convert ground & lowest layer temperature to potential temperature: - !psfc cmb - psfc(i)=psfcpa(i)/1000. - thgb(i)=tsk(i)*(100./psfc(i))**rovcp !(K) - !PL cmb - pl=p1d(i)/1000. - thcon=(100./pl)**rovcp - th1d(i)=t1d(i)*thcon !(Theta, K) - tc1d(i)=t1d(i)-273.15 !(T, Celsius) - - !convert to virtual temperature - qvsh(i)=qv1d(i)/(1.+qv1d(i)) !convert to spec hum (kg/kg) - tvcon=(1.+ep1*qvsh(i)) - thv1d(i)=th1d(i)*tvcon !(K) - tv1d(i)=t1d(i)*tvcon !(K) - - !rho1d(i)=psfcpa(i)/(r*tv1d(i)) !now using value calculated in sfc driver - za(i)=0.5*dz8w1d(i) !height of first half-sigma level - za2(i)=dz8w1d(i) + 0.5*dz2w1d(i) !height of 2nd half-sigma level - govrth(i)=g/th1d(i) - enddo - - do i=its,ite - if (tsk(i) .lt. 273.15) then - !saturation vapor pressure wrt ice (svp1=.6112; 10*mb) - e1=svp1*exp(4648*(1./273.15 - 1./tsk(i)) - & - & 11.64*log(273.15/tsk(i)) + 0.02265*(273.15 - tsk(i))) - else - !saturation vapor pressure wrt water (Bolton 1980) - e1=svp1*exp(svp2*(tsk(i)-svpt0)/(tsk(i)-svp3)) - endif - !for land points, qsfc can come from lsm, only recompute over water - if (xland(i).gt.1.5 .or. qsfc(i).le.0.0) then !water - qsfc(i)=ep2*e1/(psfc(i)-ep3*e1) !specific humidity - qsfcmr(i)=ep2*e1/(psfc(i)-e1) !mixing ratio - else !land - qsfcmr(i)=qsfc(i)/(1.-qsfc(i)) - endif - - !qgh changed to use lowest-level air temp consistent with myjsfc change - !q2sat = qgh in LSM - if (tsk(i) .lt. 273.15) then - !saturation vapor pressure wrt ice - e1=svp1*exp(4648*(1./273.15 - 1./t1d(i)) - & - & 11.64*log(273.15/t1d(i)) + 0.02265*(273.15 - t1d(i))) - else - !saturation vapor pressure wrt water (Bolton 1980) - e1=svp1*exp(svp2*(t1d(i)-svpt0)/(t1d(i)-svp3)) - endif - pl=p1d(i)/1000. - !qgh(i)=ep2*e1/(pl-ep_3*e1) !specific humidity - qgh(i)=ep2*e1/(pl-e1) !mixing ratio - cpm(i)=cp*(1.+0.84*qv1d(i)) - enddo - - do i=its,ite - wspd(i)=sqrt(u1d(i)*u1d(i)+v1d(i)*v1d(i)) - - !tgs:thvgb(i)=thgb(i)*(1.+ep1*qsfc(i)*mavail(i)) - thvgb(i)=thgb(i)*(1.+ep1*qsfc(i)) - - dthdz=(th1d(i)-thgb(i)) - dthvdz=(thv1d(i)-thvgb(i)) - - !-------------------------------------------------------- - ! Calculate the convective velocity scale (WSTAR) and - ! subgrid-scale velocity (VSGD) following Beljaars (1995, QJRMS) - ! and Mahrt and Sun (1995, MWR) low-res correction, respectively - ! (vsgd; for coeff 0.32, 13 km ~ 0.37 m/s; for 3 km == 0 m/s) - !------------------------------------------------------- - !Use Beljaars over land and water - fluxc = max(hfx(i)/rho1d(i)/cp & - & + ep1*thvgb(i)*qfx(i)/rho1d(i),0.) - !wstar(i) = vconvc*(g/tsk(i)*pblh(i)*fluxc)**.33 - if (xland(i).gt.1.5 .or. qsfc(i).le.0.0) then !water - wstar(i) = vconvc*(g/tsk(i)*pblh(i)*fluxc)**.33 - vsgd = 0.20 * (max(dx(i)/5000.-1.,0.))**.33 - else !land - !increase height scale, assuming that the non-local transoport - !from the mass-flux (plume) mixing exceedsd the pblh. - wstar(i) = vconvc*(g/tsk(i)*min(1.5*pblh(i),4000.)*fluxc)**.33 - vsgd = 0.20 * (max(dx(i)/5000.-1.,0.))**.33 - endif - wspd(i)=sqrt(wspd(i)*wspd(i)+wstar(i)*wstar(i)+vsgd*vsgd) - wspd(i)=max(wspd(i),wmin) - - !-------------------------------------------------------- - ! calculate the bulk richardson number of surface layer, - ! according to Akb(1976), Eq(12). - !-------------------------------------------------------- - br(i)=govrth(i)*za(i)*dthvdz/(wspd(i)*wspd(i)) - if (.not. restart_or_cycle .and. itimestep == 1) then - !set limits according to Li et al. (2010) boundary-layer meteorol (p.158) - br(i)=max(br(i),-2.0) - br(i)=min(br(i),2.0) - else - br(i)=max(br(i),-4.0) - br(i)=min(br(i), 4.0) - endif - - ! if previously unstable, do not let into regimes 1 and 2 (stable) - ! if (itimestep .gt. 1) then - ! if(mol(i).lt.0.)br(i)=min(br(i),0.0) - !endif - - enddo - - 1006 format(a,f7.3,a,f9.4,a,f9.5,a,f9.4) - 1007 format(a,f2.0,a,f6.2,a,f7.3,a,f7.2) - - if (debug_code) then - do i=its,ite - print*,"===important input to mynnsfclay: i=",i," ITIME=",ITIMESTEP - print*,"xland=",xland(i)," pblh=",pblh(i)," tsk=",tsk(i), & - " th1=", th1d(i)," qsfc=", qsfc(i)," znt=", znt(i), & - " ust=", ust(i)," snowh=", snowh(i)," psfcpa=",PSFCPA(i), & - " fluxc=",fluxc," qfx=",qfx(i)," hfx=",hfx(i), & - " u1=",u1d(i)," v1=",v1d(i)," qv1=",qvsh(i), & - " rho=",rho1d(i)," w*=",wstar(i)," dz1=",za(i), & - " br=",br(i)," THVGB=",THVGB(i)," DTHVDZ=",DTHVDZ, & - " psim_stab=",psim_stab(1)," psim_unstab=",psim_stab(1), & - " psih_stab=",psih_stab(1)," psih_unstab=",psih_unstab(1) - enddo - endif - -!-------------------------------------------------------------------- -!-------------------------------------------------------------------- -!--- begin i-loop -!-------------------------------------------------------------------- -!-------------------------------------------------------------------- - - do i=its,ite - - !compute kinematic viscosity (m2/s) Andreas (1989) CRREL Rep. 89-11 - !valid between -173 and 277 degrees C. - visc=1.326e-5*(1. + 6.542e-3*tc1d(i) + 8.301e-6*tc1d(i)*tc1d(i) & - - 4.84e-9*tc1d(i)*tc1d(i)*tc1d(i)) - - if ((xland(i)-1.5).ge.0) then - !-------------------------------------- - ! water - !-------------------------------------- - ! calculate z0 (znt) - !-------------------------------------- - if ( present(isftcflx) ) then - if ( isftcflx .eq. 0 ) then - if (coare_opt .eq. 3.0) then - !COARE 3.0 (misleading subroutine name) - call charnock_1955(znt(i),ust(i),wspd(i),visc,za(i)) - else - !COARE 3.5 - call edson_etal_2013(znt(i),ust(i),wspd(i),visc,za(i)) - endif - elseif ( isftcflx .eq. 1 .or. isftcflx .eq. 2 ) then - call davis_etal_2008(znt(i),ust(i)) - elseif ( isftcflx .eq. 3 ) then - call taylor_yelland_2001(znt(i),ust(i),wspd(i)) - elseif ( isftcflx .eq. 4 ) then - if (coare_opt .eq. 3.0) then - !COARE 3.0 (MISLEADING SUBROUTINE NAME) - call charnock_1955(znt(i),ust(i),wspd(i),visc,za(i)) - else - !COARE 3.5 - call edson_etal_2013(znt(i),ust(i),wspd(i),visc,za(i)) - endif - endif - else - !default to COARE 3.0/3.5 - if (coare_opt .eq. 3.0) then - !COARE 3.0 - call charnock_1955(znt(i),ust(i),wspd(i),visc,za(i)) - else - !COARE 3.5 - call edson_etal_2013(znt(i),ust(i),wspd(i),visc,za(i)) - endif - endif - - !add stochastic perturbaction of ZNT - if (spp_pbl) then - zntstoch(i) = max(znt(i) + znt(i)*1.0*rstoch1d(i), 1e-6) - else - zntstoch(i) = znt(i) - endif - - !compute roughness reynolds number (restar) using new znt - ! AHW: Garrattt formula: Calculate roughness Reynolds number - ! Kinematic viscosity of air (linear approx to - ! temp dependence at sea level) - restar=max(ust(i)*zntstoch(i)/visc, 0.1) - - !-------------------------------------- - !calculate z_t and z_q - !-------------------------------------- - if ( present(isftcflx) ) then - if ( isftcflx .eq. 0 ) then - if (coare_opt .eq. 3.0) then - call fairall_etal_2003(z_t(i),z_q(i),restar,ust(i),visc,rstoch1d(i),spp_pbl) - else - !presumably, this will be published soon, but hasn't yet - call fairall_etal_2014(z_t(i),z_q(i),restar,ust(i),visc,rstoch1d(i),spp_pbl) - endif - elseif ( isftcflx .eq. 1 ) then - if (coare_opt .eq. 3.0) then - call fairall_etal_2003(z_t(i),z_q(i),restar,ust(i),visc,rstoch1d(i),spp_pbl) - else - call fairall_etal_2014(z_t(i),z_q(i),restar,ust(i),visc,rstoch1d(i),spp_pbl) - endif - elseif ( isftcflx .eq. 2 ) then - call garratt_1992(z_t(i),z_q(i),zntstoch(i),restar,xland(i)) - elseif ( isftcflx .eq. 3 ) then - if (coare_opt .eq. 3.0) then - call fairall_etal_2003(z_t(i),z_q(i),restar,ust(i),visc,rstoch1d(i),spp_pbl) - else - call fairall_etal_2014(z_t(i),z_q(i),restar,ust(i),visc,rstoch1d(i),spp_pbl) - endif - endif - else - !default to COARE 3.0/3.5 - if (coare_opt .eq. 3.0) then - call fairall_etal_2003(z_t(i),z_q(i),restar,ust(i),visc,rstoch1d(i),spp_pbl) - else - call fairall_etal_2014(z_t(i),z_q(i),restar,ust(i),visc,rstoch1d(i),spp_pbl) - endif - endif - - else - - !add stochastic perturbaction of znt - if (spp_pbl) then - zntstoch(i) = max(znt(i) + znt(i)*1.0*rstoch1d(i), 1e-6) - else - zntstoch(i) = znt(i) - endif - - !-------------------------------------- - ! land - !-------------------------------------- - !compute roughness reynolds number (restar) using default znt - restar=max(ust(i)*zntstoch(i)/visc, 0.1) - - !-------------------------------------- - ! get z_t and z_q - !-------------------------------------- - !check for snow/ice points over land - if ( snowh(i) .ge. 0.1) then - call andreas_2002(zntstoch(i),visc,ust(i),z_t(i),z_q(i)) - else - if ( present(iz0tlnd) ) then - if ( iz0tlnd .le. 1 ) then - call zilitinkevich_1995(zntstoch(i),z_t(i),z_q(i),restar,& - ust(i),karman,xland(i),iz0tlnd,spp_pbl,rstoch1d(i)) - elseif ( iz0tlnd .eq. 2 ) then - call yang_2008(zntstoch(i),z_t(i),z_q(i),ust(i),mol(i),& - qstar(i),restar,visc,xland(i)) - elseif ( iz0tlnd .eq. 3 ) then - !original mynn in wrf-arw used this form: - call garratt_1992(z_t(i),z_q(i),zntstoch(i),restar,xland(i)) - endif - else - !default to zilitinkevich - call zilitinkevich_1995(zntstoch(i),z_t(i),z_q(i),restar,& - ust(i),karman,xland(i),0,spp_pbl,rstoch1d(i)) - endif - endif - - endif - zratio(i)=zntstoch(i)/z_t(i) !needed for Li et al. - - gz1oz0(i)= log((za(i)+zntstoch(i))/zntstoch(i)) - gz1ozt(i)= log((za(i)+zntstoch(i))/z_t(i)) - gz2oz0(i)= log((2.0+zntstoch(i))/zntstoch(i)) - gz2ozt(i)= log((2.0+zntstoch(i))/z_t(i)) - gz10oz0(i)=log((10.+zntstoch(i))/zntstoch(i)) - gz10ozt(i)=log((10.+zntstoch(i))/z_t(i)) - - !-------------------------------------------------------------------- - !--- DIAGNOSE BASIC PARAMETERS FOR THE APPROPRIATE STABILITY CLASS: - ! - ! THE STABILITY CLASSES ARE DETERMINED BY BR (BULK RICHARDSON NO.). - ! - ! CRITERIA FOR THE CLASSES ARE AS FOLLOWS: - ! - ! 1. BR .GE. 0.2; - ! REPRESENTS NIGHTTIME STABLE CONDITIONS (REGIME=1), - ! - ! 2. BR .LT. 0.2 .AND. BR .GT. 0.0; - ! REPRESENTS DAMPED MECHANICAL TURBULENT CONDITIONS - ! (REGIME=2), - ! - ! 3. BR .EQ. 0.0 - ! REPRESENTS FORCED CONVECTION CONDITIONS (REGIME=3), - ! - ! 4. BR .LT. 0.0 - ! REPRESENTS FREE CONVECTION CONDITIONS (REGIME=4). - ! - !-------------------------------------------------------------------- - if (br(i) .gt. 0.0) then - if (br(i) .gt. 0.2) then - !---class 1; stable (nighttime) conditions: - regime(i)=1. - else - !---class 2; damped mechanical turbulence: - regime(i)=2. - endif - - if (.not. restart_or_cycle .and. itimestep .le. 1) then - !compute z/l first guess: - call li_etal_2010(zol(i),br(i),za(i)/zntstoch(i),zratio(i)) - else - zol(i)=za(i)*karman*g*mol(i)/(th1d(i)*max(ust(i)*ust(i),0.0001)) - zol(i)=max(zol(i),0.0) - zol(i)=min(zol(i),20.) - endif - - !Use Pedros iterative function to find z/L - !zol(i)=zolri(br(i),za(i),zntstoch(i),z_t(i),zol(i),psi_opt) - !Use brute-force method - zol(i)=zolrib(br(i),za(i),zntstoch(i),z_t(i),gz1oz0(i),gz1ozt(i),zol(i),psi_opt) - zol(i)=max(zol(i),0.0) - zol(i)=min(zol(i),20.) - - zolzt = zol(i)*z_t(i)/za(i) ! zt/l - zolz0 = zol(i)*zntstoch(i)/za(i) ! z0/l - zolza = zol(i)*(za(i)+zntstoch(i))/za(i) ! (z+z0/l - zol10 = zol(i)*(10.+zntstoch(i))/za(i) ! (10+z0)/l - zol2 = zol(i)*(2.+zntstoch(i))/za(i) ! (2+z0)/l - - !compute psim and psih - if ((xland(i)-1.5).ge.0) then - ! water - !call psi_suselj_sood_2010(psim(i),psih(i),zol(i)) - !call psi_beljaars_holtslag_1991(psim(i),psih(i),zol(i)) - !call psi_businger_1971(psim(i),psih(i),zol(i)) - !call psi_dyerhicks(psim(i),psih(i),zol(i),z_t(i),zntstoch(i),za(i)) - !call psi_cb2005(psim(i),psih(i),zolza,zolz0) - ! or use tables - psim(i)=psim_stable(zolza,psi_opt)-psim_stable(zolz0,psi_opt) - psih(i)=psih_stable(zolza,psi_opt)-psih_stable(zolzt,psi_opt) - psim10(i)=psim_stable(zol10,psi_opt)-psim_stable(zolz0,psi_opt) - psih10(i)=psih_stable(zol10,psi_opt)-psih_stable(zolz0,psi_opt) - psih2(i)=psih_stable(zol2,psi_opt)-psih_stable(zolz0,psi_opt) - else - ! land - !call psi_beljaars_holtslag_1991(psim(i),psih(i),zol(i)) - !call psi_businger_1971(psim(i),psih(i),zol(i)) - !call psi_zilitinkevich_esau_2007(psim(i),psih(i),zol(i)) - !call psi_dyerhicks(psim(i),psih(i),zol(i),z_t(i),zntstoch(i),za(i)) - !call psi_cb2005(psim(i),psih(i),zolza,zolz0) - ! or use tables - psim(i)=psim_stable(zolza,psi_opt)-psim_stable(zolz0,psi_opt) - psih(i)=psih_stable(zolza,psi_opt)-psih_stable(zolzt,psi_opt) - psim10(i)=psim_stable(zol10,psi_opt)-psim_stable(zolz0,psi_opt) - psih10(i)=psih_stable(zol10,psi_opt)-psih_stable(zolz0,psi_opt) - psih2(i)=psih_stable(zol2,psi_opt)-psih_stable(zolz0,psi_opt) - endif - - !psim10(i)=10./za(i)*psim(i) - !psih10(i)=10./za(i)*psih(i) - !psim2(i)=2./za(i)*psim(i) - !psih2(i)=2./za(i)*psih(i) - - ! 1.0 over monin-obukhov length - rmol(i)= zol(i)/za(i) - - elseif(br(i) .eq. 0.) then - !========================================================= - !-----class 3; forced convection/neutral: - !========================================================= - regime(i)=3. - - psim(i)=0.0 - psih(i)=psim(i) - psim10(i)=0. - psih10(i)=0. - psih2(i)=0. - - zol(i)=0. - !if (ust(i) .lt. 0.01) then - ! zol(i)=br(i)*gz1oz0(i) - !else - ! zol(i)=karman*govrth(i)*za(i)*mol(i)/(max(ust(i)*ust(i),0.001)) - !endif - rmol(i) = zol(i)/za(i) - - elseif(br(i) .lt. 0.)then - !========================================================== - !-----class 4; free convection: - !========================================================== - regime(i)=4. - - if (.not. restart_or_cycle .and. itimestep .le. 1) then - !compute z/l first guess: - call li_etal_2010(zol(i),br(i),za(i)/zntstoch(i),zratio(i)) - else - zol(i)=za(i)*karman*g*mol(i)/(th1d(i)*max(ust(i)*ust(i),0.001)) - zol(i)=max(zol(i),-20.0) - zol(i)=min(zol(i),0.0) - endif - - !Use Pedros iterative function to find z/L - !zol(I)=zolri(br(I),ZA(I),ZNTstoch(I),z_t(I),ZOL(I),psi_opt) - !Use alternative method - zol(i)=zolrib(br(i),za(i),zntstoch(i),z_t(i),gz1oz0(i),gz1ozt(i),zol(i),psi_opt) - zol(i)=max(zol(i),-20.0) - zol(i)=min(zol(i),0.0) - - zolzt = zol(i)*z_t(i)/za(i) ! zt/l - zolz0 = zol(i)*zntstoch(i)/za(i) ! z0/l - zolza = zol(i)*(za(i)+zntstoch(i))/za(i) ! (z+z0/l - zol10 = zol(i)*(10.+zntstoch(i))/za(i) ! (10+z0)/l - zol2 = zol(i)*(2.+zntstoch(i))/za(i) ! (2+z0)/l - - !compute psim and psih - if ((xland(i)-1.5).ge.0) then - ! water - !call psi_suselj_sood_2010(psim(i),psih(i),zol(i)) - !call psi_hogstrom_1996(psim(i),psih(i),zol(i), z_t(i), zntstoch(i), za(i)) - !call psi_businger_1971(psim(i),psih(i),zol(i)) - !call psi_dyerhicks(psim(i),psih(i),zol(i),z_t(i),zntstoch(i),za(i)) - ! use tables - psim(i)=psim_unstable(zolza,psi_opt)-psim_unstable(zolz0,psi_opt) - psih(i)=psih_unstable(zolza,psi_opt)-psih_unstable(zolzt,psi_opt) - psim10(i)=psim_unstable(zol10,psi_opt)-psim_unstable(zolz0,psi_opt) - psih10(i)=psih_unstable(zol10,psi_opt)-psih_unstable(zolz0,psi_opt) - psih2(i)=psih_unstable(zol2,psi_opt)-psih_unstable(zolz0,psi_opt) - else - ! land - !call psi_hogstrom_1996(psim(i),psih(i),zol(i), z_t(i), zntstoch(i), za(i)) - !call psi_businger_1971(psim(i),psih(i),zol(i)) - !call psi_dyerhicks(psim(i),psih(i),zol(i),z_t(i),zntstoch(i),za(i)) - ! use tables - psim(i)=psim_unstable(zolza,psi_opt)-psim_unstable(zolz0,psi_opt) - psih(i)=psih_unstable(zolza,psi_opt)-psih_unstable(zolzt,psi_opt) - psim10(i)=psim_unstable(zol10,psi_opt)-psim_unstable(zolz0,psi_opt) - psih10(i)=psih_unstable(zol10,psi_opt)-psih_unstable(zolz0,psi_opt) - psih2(i)=psih_unstable(zol2,psi_opt)-psih_unstable(zolz0,psi_opt) - endif - - !psim10(i)=10./za(i)*psim(i) - !psih2(i)=2./za(i)*psih(i) - - !---limit psih and psim in the case of thin layers and - !---high roughness. this prevents denominator in fluxes - !---from getting too small - psih(i)=min(psih(i),0.9*gz1ozt(i)) - psim(i)=min(psim(i),0.9*gz1oz0(i)) - psih2(i)=min(psih2(i),0.9*gz2ozt(i)) - psim10(i)=min(psim10(i),0.9*gz10oz0(i)) - psih10(i)=min(psih10(i),0.9*gz10ozt(i)) - - rmol(i) = zol(i)/za(i) - - endif - - !------------------------------------------------------------ - !-----compute the frictional velocity: - !------------------------------------------------------------ - ! over water, apply maximum cd (=3.1e-3), which corresponds to - ! psix10 = 7.1: - if ((xland(i)-1.5).lt.0.) then !land - psix=gz1oz0(i)-psim(i) - psix10=gz10oz0(i)-psim10(i) - else !water - psix10=max(gz10oz0(i)-psim10(i),7.1) - psix_min=7.1*log(za(i)/zntstoch(i))/log(10./zntstoch(i)) - psix=max(gz1oz0(i)-psim(i), psix_min) - endif - ! to prevent oscillations average with old value - oldust = ust(i) - ust(i)=0.5*ust(i)+0.5*karman*wspd(i)/psix - !non-averaged: ust(i)=karman*wspd(i)/psix - - ! compute u* without vconv for use in hfx calc when isftcflx > 0 - wspdi(i)=max(sqrt(u1d(i)*u1d(i)+v1d(i)*v1d(i)), wmin) - if ( present(ustm) ) then - ustm(i)=0.5*ustm(i)+0.5*karman*wspdi(i)/psix - endif - - if ((xland(i)-1.5).lt.0.) then !land - ust(i)=max(ust(i),0.005) !further relaxing this limit - no need to go lower - !keep ustm = ust over land. - if ( present(ustm) ) ustm(i)=ust(i) - endif - - !------------------------------------------------------------ - !-----compute the thermal and moisture resistance (psiq and psit): - !------------------------------------------------------------ - ! lower limit added to prevent large flhc in soil model - ! activates in unstable conditions with thin layers or high z0 - gz1ozt(i)= log((za(i)+zntstoch(i))/z_t(i)) - gz2ozt(i)= log((2.0+zntstoch(i))/z_t(i)) - - psit =max(gz1ozt(i)-psih(i) ,1.) - psit2=max(gz2ozt(i)-psih2(i),1.) - - psiq=max(log((za(i)+zntstoch(i))/z_q(i))-psih(i) ,1.0) - psiq2=max(log((2.0+zntstoch(i))/z_q(i))-psih2(i) ,1.0) - psiq10=max(log((10.0+zntstoch(i))/z_q(i))-psih10(i) ,1.0) - !---------------------------------------------------- - !compute the temperature scale (or friction temperature, T*) - !---------------------------------------------------- - dtg=thv1d(i)-thvgb(i) - oldtst=mol(i) - mol(i)=karman*dtg/psit/prt - !t_star(i) = -hfx(i)/(ust(i)*cpm(i)*rho1d(i)) - !t_star(i) = mol(i) - !---------------------------------------------------- - !compute the moisture scale (or q*) - dqg=(qvsh(i)-qsfc(i))*1000. !(kg/kg -> g/kg) - qstar(i)=karman*dqg/psiq/prt - - !if () then - ! write(*,1001)"regime:",regime(i)," z/l:",zol(i)," u*:",ust(i)," tstar:",mol(i) - ! write(*,1002)"psim:",psim(i)," psih:",psih(i)," w*:",wstar(i)," dthv:",thv1d(i)-thvgb(i) - ! write(*,1003)"cpm:",cpm(i)," rho1d:",rho1d(i)," l:",zol(i)/za(i)," dth:",th1d(i)-thgb(i) - ! write(*,1004)"z0/zt:",zratio(i)," z0:",zntstoch(i)," zt:",z_t(i)," za:",za(i) - ! write(*,1005)"re:",restar," mavail:",mavail(i)," qsfc(i):",qsfc(i)," qvsh(i):",qvsh(i) - ! print*,"visc=",visc," z0:",zntstoch(i)," t1d(i):",t1d(i) - ! write(*,*)"=============================================" - !endif - - enddo ! end i-loop - - 1000 format(a,f6.1, a,f6.1, a,f5.1, a,f7.1) - 1001 format(a,f2.0, a,f10.4,a,f5.3, a,f11.5) - 1002 format(a,f7.2, a,f7.2, a,f7.2, a,f10.3) - 1003 format(a,f7.2, a,f7.2, a,f10.3,a,f10.3) - 1004 format(a,f11.3,a,f9.7, a,f9.7, a,f6.2, a,f10.3) - 1005 format(a,f9.2,a,f6.4,a,f7.4,a,f7.4) - - !---------------------------------------------------------- - ! compute surface heat and moisture fluxes - !---------------------------------------------------------- - do i=its,ite - - !For computing the diagnostics and fluxes (below), whether the fluxes - !are turned off or on, we need the following: - ! over water, apply maximum cd (=3.1e-3), which corresponds to - ! psix = 7.1 (at 10 m): - if ((xland(i)-1.5).lt.0.) then !land - psix=gz1oz0(i)-psim(i) - psix10=gz10oz0(i)-psim10(i) - else !water - psix10=max(gz10oz0(i)-psim10(i),7.1) - psix_min=7.1*log(za(i)/zntstoch(i))/log(10./zntstoch(i)) - psix=max(gz1oz0(i)-psim(i), psix_min) - endif - - psit =max(gz1ozt(i)-psih(i), 1.0) - psit2=max(gz2ozt(i)-psih2(i),1.0) - - psiq=max(log((za(i)+z_q(i))/z_q(i))-psih(i) ,1.0) - psiq2=max(log((2.0+z_q(i))/z_q(i))-psih2(i) ,1.0) - psiq10=max(log((10.0+z_q(i))/z_q(i))-psih10(i) ,1.0) - - if (isfflx .lt. 1) then - - qfx(i) = 0. - hfx(i) = 0. - flhc(i) = 0. - flqc(i) = 0. - lh(i) = 0. - chs(i) = 0. - ch(i) = 0. - cqs(i) = 0. - chs2(i) = 0. - cqs2(i) = 0. - if(present(ck) .and. present(cd) .and. & - &present(cka) .and. present(cda)) then - ck(i) = 0. - cd(i) = 0. - cka(i)= 0. - cda(i)= 0. - endif - else - - !------------------------------------------ - ! calculate the exchange coefficients for heat (flhc) - ! and moisture (flqc) - !------------------------------------------ - flqc(i)=rho1d(i)*mavail(i)*ust(i)*karman/psiq - flhc(i)=rho1d(i)*cpm(i)*ust(i)*karman/psit - - !---------------------------------- - ! compute surface moisture flux: - !---------------------------------- - qfx(i)=flqc(i)*(qsfcmr(i)-qv1d(i)) - !joe: qfx(i)=max(qfx(i),0.) !originally did not allow neg qfx - qfx(i)=max(qfx(i),-0.02) !allows small neg qfx, like myj - lh(i)=xlv*qfx(i) - - !---------------------------------- - ! compute surface heat flux: - !---------------------------------- - if(xland(i)-1.5.gt.0.)then !water - hfx(i)=flhc(i)*(thgb(i)-th1d(i)) - if ( present(isftcflx) ) then - if ( isftcflx.ne.0 ) then - ! ahw: add dissipative heating term - hfx(i)=hfx(i)+rho1d(i)*ustm(i)*ustm(i)*wspdi(i) - endif - endif - elseif(xland(i)-1.5.lt.0.)then !land - hfx(i)=flhc(i)*(thgb(i)-th1d(i)) - hfx(i)=max(hfx(i),-250.) - endif - - !chs(i)=ust(i)*karman/(alog(karman*ust(i)*za(i) & - ! /xka+za(i)/zl)-psih(i)) - - chs(i)=ust(i)*karman/psit - - ! the exchange coefficient for cloud water is assumed to be the - ! same as that for heat. ch is multiplied by wspd. - - !ch(i)=chs(i) - ch(i)=flhc(i)/( cpm(i)*rho1d(i) ) - - !these are used for 2-m diagnostics only - cqs(i) =ust(i)*karman/psiq - cqs2(i)=ust(i)*karman/psiq2 - chs2(i)=ust(i)*karman/psit2 - - if(present(ck) .and. present(cd) .and. & - &present(cka) .and. present(cda)) then - ck(i)=(karman/psix10)*(karman/psiq10) - cd(i)=(karman/psix10)*(karman/psix10) - cka(i)=(karman/psix)*(karman/psiq) - cda(i)=(karman/psix)*(karman/psix) - endif - - endif !end isfflx option - - !----------------------------------------------------- - !compute diagnostics - !----------------------------------------------------- - !compute 10 m wnds - !----------------------------------------------------- - ! If the lowest model level is close to 10-m, use it - ! instead of the flux-based diagnostic formula. - if (za(i) .le. 7.0) then - ! high vertical resolution - if(za2(i) .gt. 7.0 .and. za2(i) .lt. 13.0) then - !use 2nd model level - u10(i)=u1d2(i) - v10(i)=v1d2(i) - else - u10(i)=u1d(i)*log(10./zntstoch(i))/log(za(i)/zntstoch(i)) - v10(i)=v1d(i)*log(10./zntstoch(i))/log(za(i)/zntstoch(i)) - endif - elseif(za(i) .gt. 7.0 .and. za(i) .lt. 13.0) then - !moderate vertical resolution - !u10(i)=u1d(i)*psix10/psix - !v10(i)=v1d(i)*psix10/psix - !use neutral-log: - u10(i)=u1d(i)*log(10./zntstoch(i))/log(za(i)/zntstoch(i)) - v10(i)=v1d(i)*log(10./zntstoch(i))/log(za(i)/zntstoch(i)) - else - ! very coarse vertical resolution - u10(i)=u1d(i)*psix10/psix - v10(i)=v1d(i)*psix10/psix - endif - - !----------------------------------------------------- - !compute 2m t, th, and q - !these will be overwritten for land points in the lsm - !----------------------------------------------------- - dtg=th1d(i)-thgb(i) - th2(i)=thgb(i)+dtg*psit2/psit - !*** be certain that the 2-m theta is bracketed by - !*** the values at the surface and lowest model level. - if ((th1d(i)>thgb(i) .and. (th2(i)th1d(i))) .or. & - (th1d(i)thgb(i) .or. th2(i) 1200. .or. hfx(i) < -700.)then - print*,"suspicious values in mynn sfclayer",& - i, "hfx: ",hfx(i) - yesno = 1 - endif - if (lh(i) > 1200. .or. lh(i) < -700.)then - print*,"suspicious values in mynn sfclayer",& - i, "lh: ",lh(i) - yesno = 1 - endif - if (ust(i) < 0.0 .or. ust(i) > 4.0 )then - print*,"suspicious values in mynn sfclayer",& - i, "ust: ",ust(i) - yesno = 1 - endif - if (wstar(i)<0.0 .or. wstar(i) > 6.0)then - print*,"suspicious values in mynn sfclayer",& - i, "wstar: ",wstar(i) - yesno = 1 - endif - if (rho1d(i)<0.0 .or. rho1d(i) > 1.6 )then - print*,"suspicious values in mynn sfclayer",& - i, "rho: ",rho1d(i) - yesno = 1 - endif - if (qsfc(i)*1000. <0.0 .or. qsfc(i)*1000. >40.)then - print*,"suspicious values in mynn sfclayer",& - i, "qsfc: ",qsfc(i) - yesno = 1 - endif - if (pblh(i)<0. .or. pblh(i)>6000.)then - print*,"suspicious values in mynn sfclayer",& - i, "pblh: ",pblh(i) - yesno = 1 - endif - - if (yesno == 1) then - print*," other info:" - write(*,1001)"regime:",regime(i)," z/l:",zol(i)," u*:",ust(i),& - " tstar:",mol(i) - write(*,1002)"psim:",psim(i)," psih:",psih(i)," w*:",wstar(i),& - " dthv:",thv1d(i)-thvgb(i) - write(*,1003)"cpm:",cpm(i)," rho1d:",rho1d(i)," l:",& - zol(i)/za(i)," dth:",th1d(i)-thgb(i) - write(*,*)" z0:",zntstoch(i)," zt:",z_t(i)," za:",za(i) - write(*,1005)"re:",restar," mavail:",mavail(i)," qsfc(i):",& - qsfc(i)," qvsh(i):",qvsh(i) - print*,"psix=",psix," z0:",zntstoch(i)," t1d(i):",t1d(i) - write(*,*)"=============================================" - endif - endif - - enddo !end i-loop - - errmsg = ' ' - errflg = 0 - - end subroutine mynnsfclay - -!================================================================================================================= - subroutine zilitinkevich_1995(z_0,zt,zq,restar,ustar,karman,landsea,iz0tlnd2,spp_pbl,rstoch) -!this subroutine returns the thermal and moisture roughness lengths -!from Zilitinkevich (1995) and Zilitinkevich et al. (2001) over -!land and water, respectively. -! -!MODS: -!20120705 : added IZ0TLND option. Note: This option was designed -! to work with the Noah LSM and may be specific for that -! LSM only. Tests with RUC LSM showed no improvements. - implicit none -!================================================================================================================= - -!--- input arguments: - logical,intent(in):: spp_pbl - integer,optional,intent(in):: iz0tlnd2 - - real(kind=kind_phys),intent(in):: rstoch - real(kind=kind_phys),intent(in):: z_0,restar,ustar,karman,landsea - -!--- output arguments: - real(kind=kind_phys),intent(out):: zt,zq - -!--- local variables: - real(kind=kind_phys):: czil !=0.100 in Chen et al. (1997) - !=0.075 in Zilitinkevich (1995) - !=0.500 in Lemone et al. (2008) - -!----------------------------------------------------------------------------------------------------------------- - - if (landsea-1.5 .gt. 0) then !water - -!this is based on Zilitinkevich, Grachev, and Fairall (2001): -!their equations 15 and 16). - if (restar .lt. 0.1) then - zt = z_0*exp(karman*2.0) - zt = min( zt, 6.0e-5) - zt = max( zt, 2.0e-9) - zq = z_0*exp(karman*3.0) - zq = min( zq, 6.0e-5) - zq = max( zq, 2.0e-9) - else - zt = z_0*exp(-karman*(4.0*sqrt(restar)-3.2)) - zt = min( zt, 6.0e-5) - zt = max( zt, 2.0e-9) - zq = z_0*exp(-karman*(4.0*sqrt(restar)-4.2)) - zq = min( zt, 6.0e-5) - zq = max( zt, 2.0e-9) - endif - - else !land - -!option to modify czil according to Chen & Zhang (2009): - if ( iz0tlnd2 .eq. 1 ) then - czil = 10.0 ** ( -0.40 * ( z_0 / 0.07 ) ) - else - czil = 0.095 !0.075 !0.10 - end if - - zt = z_0*exp(-karman*czil*sqrt(restar)) - zt = min( zt, 0.75*z_0) - - zq = z_0*exp(-karman*czil*sqrt(restar)) - zq = min( zq, 0.75*z_0) - -!stochastically perturb thermal and moisture roughness length. -!currently set to half the amplitude: - if (spp_pbl) then - zt = zt + zt * 0.5 * rstoch - zt = max(zt, 0.0001) - zq = zt - endif - - endif - - end subroutine zilitinkevich_1995 - -!================================================================================================================= - subroutine davis_etal_2008(Z_0,ustar) -!a.k.a. : Donelan et al. (2004) -!this formulation for roughness length was designed to match -!the labratory experiments of Donelan et al. (2004). -!this is an update version from Davis et al. 2008, which -!corrects a small-bias in Z_0 (AHW real-time 2012). - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: ustar - -!--- output arguments: - real(kind=kind_phys),intent(out):: z_0 - -!--- local variables: - real(kind=kind_phys):: zw, zn1, zn2 - real(kind=kind_phys),parameter:: g=9.81,ozo=1.59e-5 - -!----------------------------------------------------------------------------------------------------------------- - -!old form: z_0 = 10.*exp(-10./(ustar**(1./3.))) -!new form: - - zw = min((ustar/1.06)**(0.3),1.0) - zn1 = 0.011*ustar*ustar/g + ozo - zn2 = 10.*exp(-9.5*ustar**(-.3333)) + & - 0.11*1.5e-5/amax1(ustar,0.01) - z_0 = (1.0-zw) * zn1 + zw * zn2 - - z_0 = max( z_0, 1.27e-7) !these max/mins were suggested by - z_0 = min( z_0, 2.85e-3) !Davis et al. (2008) - - end subroutine davis_etal_2008 - -!================================================================================================================= - subroutine taylor_yelland_2001(z_0,ustar,wsp10) -!this formulation for roughness length was designed account for -!wave steepness. - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: ustar,wsp10 - -!--- output arguments: - real(kind=kind_phys),intent(out):: z_0 - -!--- local variables: - real(kind=kind_phys),parameter:: g=9.81, pi=3.14159265 - real(kind=kind_phys):: hs, tp, lp - -!----------------------------------------------------------------------------------------------------------------- - -!hs is the significant wave height - hs = 0.0248*(wsp10**2.) -!Tp dominant wave period - tp = 0.729*max(wsp10,0.1) -!lp is the wavelength of the dominant wave - lp = g*tp**2/(2*pi) - - z_0 = 1200.*hs*(hs/lp)**4.5 - z_0 = max( z_0, 1.27e-7) !these max/mins were suggested by - z_0 = min( z_0, 2.85e-3) !Davis et al. (2008) - - end subroutine taylor_yelland_2001 - -!================================================================================================================= - subroutine charnock_1955(Z_0,ustar,wsp10,visc,zu) -!This version of Charnock's relation employs a varying -!Charnock parameter, similar to COARE3.0 [Fairall et al. (2003)]. -!The Charnock parameter CZC is varied from .011 to .018 -!between 10-m wsp = 10 and 18. - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: ustar,visc,wsp10,zu - -!--- output arguments: - real(kind=kind_phys),intent(out):: z_0 - -!--- local variables: - real(kind=kind_phys),parameter:: G=9.81, CZO2=0.011 - real(kind=kind_phys):: czc !variable charnock "constant" - real(kind=kind_phys):: wsp10m ! logarithmically calculated 10 m - -!----------------------------------------------------------------------------------------------------------------- - - wsp10m = wsp10*log(10./1e-4)/log(zu/1e-4) - czc = czo2 + 0.007*min(max((wsp10m-10.)/8., 0.), 1.0) - - z_0 = czc*ustar*ustar/g + (0.11*visc/max(ustar,0.05)) - z_0 = max( z_0, 1.27e-7) !these max/mins were suggested by - z_0 = min( z_0, 2.85e-3) !Davis et al. (2008) - - end subroutine charnock_1955 - -!================================================================================================================= - subroutine edson_etal_2013(z_0,ustar,wsp10,visc,zu) -!This version of Charnock's relation employs a varying -!Charnock parameter, taken from COARE 3.5 [Edson et al. (2001, JPO)]. -!The Charnock parameter CZC is varied from about .005 to .028 -!between 10-m wind speeds of 6 and 19 m/s. -!11 Nov 2021: Note that this was finally fixed according to the -! Edson et al (2014) corrigendum, where "m" was corrected. - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: ustar,visc,wsp10,zu - -!--- output arguments: - real(kind=kind_phys),intent(out):: z_0 - -!--- local variables: - real(kind=kind_phys),parameter:: g=9.81 - real(kind=kind_phys),parameter:: m=0.0017, b=-0.005 - real(kind=kind_phys):: czc ! variable charnock "constant" - real(kind=kind_phys):: wsp10m ! logarithmically calculated 10 m - -!----------------------------------------------------------------------------------------------------------------- - - wsp10m = wsp10*log(10/1e-4)/log(zu/1e-4) - wsp10m = min(19.,wsp10m) - czc = m*wsp10m + b - czc = max(czc, 0.0) - - z_0 = czc*ustar*ustar/g + (0.11*visc/max(ustar,0.07)) - z_0 = max( z_0, 1.27e-7) !These max/mins were suggested by - z_0 = min( z_0, 2.85e-3) !Davis et al. (2008) - - end subroutine edson_etal_2013 - -!================================================================================================================= - subroutine garratt_1992(zt,zq,z_0,ren,landsea) -!This formulation for the thermal and moisture roughness lengths -!(Zt and Zq) relates them to Z0 via the roughness Reynolds number (Ren). -!This formula comes from Fairall et al. (2003). It is modified from -!the original Garratt-Brutsaert model to better fit the COARE/HEXMAX -!data. The formula for land uses a constant ratio (Z_0/7.4) taken -!from Garratt (1992). - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: ren, z_0,landsea - -!--- output arguments: - real(kind=kind_phys),intent(out):: zt,zq - -!--- local variables: - real(kind=kind_phys):: rq - real(kind=kind_phys),parameter:: e=2.71828183 - -!----------------------------------------------------------------------------------------------------------------- - - if (landsea-1.5 .gt. 0) then !water - - zt = z_0*exp(2.0 - (2.48*(ren**0.25))) - zq = z_0*exp(2.0 - (2.28*(ren**0.25))) - - zq = min( zq, 5.5e-5) - zq = max( zq, 2.0e-9) - zt = min( zt, 5.5e-5) - zt = max( zt, 2.0e-9) !same lower limit as ecmwf - - else !land - - zq = z_0/(e**2.) !taken from Garratt (1980,1992) - zt = zq - - endif - - end subroutine garratt_1992 - -!================================================================================================================= - subroutine fairall_etal_2003(zt,zq,ren,ustar,visc,rstoch,spp_pbl) -!This formulation for thermal and moisture roughness length (Zt and Zq) -!as a function of the roughness Reynolds number (Ren) comes from the -!COARE3.0 formulation, empirically derived from COARE and HEXMAX data -![Fairall et al. (2003)]. Edson et al. (2004; JGR) suspected that this -!relationship overestimated the scalar roughness lengths for low Reynolds -!number flows, so an optional smooth flow relationship, taken from Garratt -!(1992, p. 102), is available for flows with Ren < 2. -! -!This is for use over water only. - implicit none -!================================================================================================================= - -!--- input arguments: - logical,intent(in):: spp_pbl - real(kind=kind_phys),intent(in):: ren,ustar,visc,rstoch - -!--- output arguments: - real(kind=kind_phys),intent(out):: zt,zq - -!----------------------------------------------------------------------------------------------------------------- - - if (ren .le. 2.) then - - zt = (5.5e-5)*(ren**(-0.60)) - zq = zt - !for smooth seas, can use Garratt - !zq = 0.2*visc/max(ustar,0.1) - !zq = 0.3*visc/max(ustar,0.1) - - else - - !for rough seas, use coare - zt = (5.5e-5)*(ren**(-0.60)) - zq = zt - - endif - - if (spp_pbl) then - zt = zt + zt * 0.5 * rstoch - zq = zt - endif - - zt = min(zt,1.0e-4) - zt = max(zt,2.0e-9) - - zq = min(zt,1.0e-4) - zq = max(zt,2.0e-9) - - end subroutine fairall_etal_2003 - -!================================================================================================================= - subroutine fairall_etal_2014(zt,zq,ren,ustar,visc,rstoch,spp_pbl) -!This formulation for thermal and moisture roughness length (Zt and Zq) -!as a function of the roughness Reynolds number (Ren) comes from the -!COARE 3.5/4.0 formulation, empirically derived from COARE and HEXMAX data -![Fairall et al. (2014? coming soon, not yet published as of July 2014)]. -!This is for use over water only. - implicit none -!================================================================================================================= - -!--- input arguments: - logical,intent(in):: spp_pbl - real(kind=kind_phys),intent(in):: ren,ustar,visc,rstoch - -!--- output arguments: - real(kind=kind_phys),intent(out):: Zt,Zq - -!----------------------------------------------------------------------------------------------------------------- - -!zt = (5.5e-5)*(ren**(-0.60)) - zt = min(1.6e-4, 5.8e-5/(ren**0.72)) - zq = zt - - if (spp_pbl) then - zt = max(zt + zt*0.5*rstoch,2.0e-9) - zq = max(zt + zt*0.5*rstoch,2.0e-9) - else - zt = max(zt,2.0e-9) - zq = max(zt,2.0e-9) - endif - - - end subroutine fairall_etal_2014 - -!================================================================================================================= - subroutine yang_2008(z_0,zt,zq,ustar,tstar,qst,ren,visc,landsea) -!This is a modified version of Yang et al (2002 QJRMS, 2008 JAMC) -!and Chen et al (2010, J of Hydromet). Although it was originally -!designed for arid regions with bare soil, it is modified -!here to perform over a broader spectrum of vegetation. -! -!The original formulation relates the thermal roughness length (Zt) -!to u* and T*: -! -! Zt = ht * EXP(-beta*(ustar**0.5)*(ABS(tstar)**0.25)) -! -!where ht = Renc*visc/ustar and the critical Reynolds number -!(Renc) = 70. Beta was originally = 10 (2002 paper) but was revised -!to 7.2 (in 2008 paper). Their form typically varies the -!ratio Z0/Zt by a few orders of magnitude (1-1E4). -! -!This modified form uses beta = 1.5 and a variable Renc (function of Z_0), -!so zt generally varies similarly to the Zilitinkevich form (with Czil ~ 0.1) -!for very small or negative surface heat fluxes but can become close to the -!Zilitinkevich with Czil = 0.2 for very large HFX (large negative T*). -!Also, the exponent (0.25) on tstar was changed to 1.0, since we found -!Zt was reduced too much for low-moderate positive heat fluxes. -! -!This should only be used over land! - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: z_0,ren,ustar,tstar,qst,visc,landsea - -!--- output arguments: - real(kind=kind_phys),intent(out):: zt,zq - -!--- local variables: - real(kind=kind_phys):: ht, &! roughness height at critical Reynolds number - tstar2, &! bounded T*, forced to be non-positive - qstar2, &! bounded q*, forced to be non-positive - z_02, &! bounded Z_0 for variable Renc2 calc - renc2 ! variable Renc, function of Z_0 - - real(kind=kind_phys),parameter:: renc=300., & !old constant Renc - beta=1.5, & !important for diurnal variation - m=170., & !slope for Renc2 function - b=691. !y-intercept for Renc2 function - -!----------------------------------------------------------------------------------------------------------------- - - z_02 = min(z_0,0.5) - z_02 = max(z_02,0.04) - renc2= b + m*log(z_02) - ht = renc2*visc/max(ustar,0.01) - tstar2 = min(tstar, 0.0) - qstar2 = min(qst,0.0) - - zt = ht * exp(-beta*(ustar**0.5)*(abs(tstar2)**1.0)) - zq = ht * exp(-beta*(ustar**0.5)*(abs(qstar2)**1.0)) -!zq = zt - - zt = min(zt, z_0/2.0) - zq = min(zq, z_0/2.0) - - end subroutine yang_2008 - -!================================================================================================================= - subroutine andreas_2002(z_0,bvisc,ustar,zt,zq) -! This is taken from Andreas (2002; J. of Hydromet) and -! Andreas et al. (2005; BLM). -! -! This should only be used over snow/ice! - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: z_0,bvisc,ustar - -!--- output arguments: - real(kind=kind_phys),intent(out):: zt, zq - -!--- local variables: - real(kind=kind_phys):: ren2,zntsno - - real(kind=kind_phys),parameter:: bt0_s=1.25, bt0_t=0.149, bt0_r=0.317, & - bt1_s=0.0, bt1_t=-0.55, bt1_r=-0.565, & - bt2_s=0.0, bt2_t=0.0, bt2_r=-0.183 - - real(kind=kind_phys),parameter:: bq0_s=1.61, bq0_t=0.351, bq0_r=0.396, & - bq1_s=0.0, bq1_t=-0.628, bq1_r=-0.512, & - bq2_s=0.0, bq2_t=0.0, bq2_r=-0.180 - -!----------------------------------------------------------------------------------------------------------------- - -!calculate zo for snow (Andreas et al. 2005, BLM): - zntsno = 0.135*bvisc/ustar + & - (0.035*(ustar*ustar)/9.8) * & - (5.*exp(-1.*(((ustar - 0.18)/0.1)*((ustar - 0.18)/0.1))) + 1.) - ren2 = ustar*zntsno/bvisc - -!Make sure that Re is not outside of the range of validity -!for using their equations - if (ren2 .gt. 1000.) ren2 = 1000. - - if (ren2 .le. 0.135) then - - zt = zntsno*exp(bt0_s + bt1_s*log(ren2) + bt2_s*log(ren2)**2) - zq = zntsno*exp(bq0_s + bq1_s*log(ren2) + bq2_s*log(ren2)**2) - - else if (ren2 .gt. 0.135 .and. ren2 .lt. 2.5) then - - zt = zntsno*exp(bt0_t + bt1_t*log(ren2) + bt2_t*log(ren2)**2) - zq = zntsno*exp(bq0_t + bq1_t*log(ren2) + bq2_t*log(ren2)**2) - - else - - zt = zntsno*exp(bt0_r + bt1_r*log(ren2) + bt2_r*log(ren2)**2) - zq = zntsno*exp(bq0_r + bq1_r*log(ren2) + bq2_r*log(ren2)**2) - - endif - - end subroutine andreas_2002 - -!================================================================================================================= - subroutine psi_hogstrom_1996(psi_m,psi_h,zl,zt,z_0,za) -!this subroutine returns the stability functions based off -!of hogstrom (1996). - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: zl,zt,z_0,za - -!--- output arguments: - real(kind=kind_phys),intent(out):: psi_m,psi_h - -!--- local variables: - real(kind=kind_phys):: x,x0,y,y0,zml,zhl - -!----------------------------------------------------------------------------------------------------------------- - - zml = z_0*zl/za - zhl = zt*zl/za - - if (zl .gt. 0.) then !stable (not well tested - seem large) - - psi_m = -5.3*(zl - zml) - psi_h = -8.0*(zl - zhl) - - else !unstable - - x = (1.-19.0*zl)**0.25 - x0= (1.-19.0*zml)**0.25 - y = (1.-11.6*zl)**0.5 - y0= (1.-11.6*zhl)**0.5 - - psi_m = 2.*log((1.+x)/(1.+x0)) + & - &log((1.+x**2.)/(1.+x0**2.)) - & - &2.0*atan(x) + 2.0*atan(x0) - psi_h = 2.*log((1.+y)/(1.+y0)) - - endif - - end subroutine psi_hogstrom_1996 - -!================================================================================================================= - subroutine psi_dyerhicks(psi_m,psi_h,zl,zt,z_0,za) -!This subroutine returns the stability functions based off -!of Hogstrom (1996), but with different constants compatible -!with Dyer and Hicks (1970/74?). This formulation is used for -!testing/development by Nakanishi (personal communication). - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: zl,zt,z_0,za - -!--- output arguments: - real(kind=kind_phys),intent(out):: psi_m,psi_h - -!--- local variables: - real(kind=kind_phys):: x,x0,y,y0,zml,zhl - -!----------------------------------------------------------------------------------------------------------------- - - zml = z_0*zl/za !zo/l - zhl = zt*zl/za !zt/l - - if (zl .gt. 0.) then !stable - - psi_m = -5.0*(zl - zml) - psi_h = -5.0*(zl - zhl) - - else !unstable - - x = (1.-16.*zl)**0.25 - x0= (1.-16.*zml)**0.25 - - y = (1.-16.*zl)**0.5 - y0= (1.-16.*zhl)**0.5 - - psi_m = 2.*log((1.+x)/(1.+x0)) + & - &log((1.+x**2.)/(1.+x0**2.)) - & - &2.0*atan(x) + 2.0*atan(x0) - psi_h = 2.*log((1.+y)/(1.+y0)) - - endif - - end subroutine psi_dyerhicks - -!================================================================================================================= - subroutine psi_beljaars_holtslag_1991(psi_m,psi_h,zl) -!this subroutine returns the stability functions based off -!of Beljaar and Holtslag 1991, which is an extension of Holtslag -!and Debruin 1989. - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: zl - -!--- output arguments: - real(kind=kind_phys),intent(out):: psi_m, psi_h - -!--- local variables: - real(kind=kind_phys):: a=1.,b=0.666,c=5.,d=0.35 - -!----------------------------------------------------------------------------------------------------------------- - - if (zl .lt. 0.) then !unstable - - write(*,*)"WARNING: Universal stability functions from" - write(*,*)" Beljaars and Holtslag (1991) should only" - write(*,*)" be used in the stable regime!" - psi_m = 0. - psi_h = 0. - - else !stable - - psi_m = -(a*zl + b*(zl -(c/d))*exp(-d*zl) + (b*c/d)) - psi_h = -((1.+.666*a*zl)**1.5 + & - b*(zl - (c/d))*exp(-d*zl) + (b*c/d) -1.) - - endif - - end subroutine psi_beljaars_holtslag_1991 - -!================================================================================================================= - subroutine psi_zilitinkevich_esau_2007(psi_m,psi_h,zl) -!this subroutine returns the stability functions come from -!Zilitinkevich and Esau (2007, BM), which are formulatioed from the -!"generalized similarity theory" and tuned to the LES DATABASE64 -!to determine their dependence on z/L. - IMPLICIT NONE -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: zl - -!--- output arguments: - real(kind=kind_phys),intent(out):: psi_m, psi_h - -!--- local variables: - real(kind=kind_phys),parameter:: cm=3.0,ct=2.5 - -!----------------------------------------------------------------------------------------------------------------- - - if (zl .lt. 0.) then !unstable - -! write(*,*)"WARNING: Universal stability function from" -! write(*,*)" Zilitinkevich and Esau (2007) should only" -! write(*,*)" be used in the stable regime!" - psi_m = 0. - psi_h = 0. - - else !stable - - psi_m = -cm*(zl**(5./6.)) - psi_h = -ct*(zl**(4./5.)) - - endif - - end subroutine psi_zilitinkevich_esau_2007 - -!================================================================================================================= - subroutine psi_businger_1971(psi_m,psi_h,zl) -!this subroutine returns the flux-profile relationships -!of Businger el al. 1971. - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: zl - -!--- output arguments: - real(kind=kind_phys),intent(out):: psi_m, psi_h - -!--- local variables: - real(kind=kind_phys):: x, y - real(kind=kind_phys),parameter:: pi180 = 3.14159265/180. - -!----------------------------------------------------------------------------------------------------------------- - - if (zl .lt. 0.) then !unstable - - x = (1. - 15.0*zl)**0.25 - y = (1. - 9.0*zl)**0.5 - - psi_m = log(((1.+x)/2.)**2.) + & - & log((1.+x**2.)/2.) - & - & 2.0*atan(x) + pi180*90. - psi_h = 2.*log((1.+y)/2.) - - else !stable - - psi_m = -4.7*zl - psi_h = -(4.7/0.74)*zl - - endif - - end subroutine psi_businger_1971 - -!================================================================================================================= - subroutine psi_suselj_sood_2010(psi_m,psi_h,zl) -!this subroutine returns flux-profile relatioships based off -!of Lobocki (1993), which is derived from the MY-level 2 model. -!Suselj and Sood (2010) applied the surface layer length scales -!from Nakanishi (2001) to get this new relationship. These functions -!are more agressive (larger magnitude) than most formulations. They -!showed improvement over water, but untested over land. - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: zl - -!--- output arguments: - real(kind=kind_phys),intent(out):: psi_m, psi_h - -!--- local variables: - real(kind=kind_phys),parameter:: rfc=0.19, ric=0.183, phit=0.8 - -!----------------------------------------------------------------------------------------------------------------- - - if (zl .gt. 0.) then !stable - - psi_m = -(zl/rfc + 1.1223*exp(1.-1.6666/zl)) - !psi_h = -zl*ric/((rfc**2.)*phit) + 8.209*(zl**1.1091) - !their eq for psi_h crashes the model and does not match - !their fig 1. this eq (below) matches their fig 1 better: - psi_h = -(zl*ric/((rfc**2.)*5.) + 7.09*(zl**1.1091)) - - else !unstable - - psi_m = 0.9904*log(1. - 14.264*zl) - psi_h = 1.0103*log(1. - 16.3066*zl) - - endif - - end subroutine psi_suselj_sood_2010 - -!================================================================================================================= - subroutine psi_cb2005(psim1,psih1,zl,z0l) -!this subroutine returns the stability functions based off -!of Cheng and Brutseart (2005, BLM), for use in stable conditions only. -!the returned values are the combination of psi((za+zo)/L) - psi(z0/L) - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: zl,z0l - -!--- output arguments: - real(kind=kind_phys),intent(out):: psim1,psih1 - -!----------------------------------------------------------------------------------------------------------------- - - psim1 = -6.1*log(zl + (1.+ zl **2.5)**0.4) & - -6.1*log(z0l + (1.+ z0l**2.5)**0.4) - psih1 = -5.5*log(zl + (1.+ zl **1.1)**0.90909090909) & - -5.5*log(z0l + (1.+ z0l**1.1)**0.90909090909) - - end subroutine psi_cb2005 - -!================================================================================================================= - subroutine li_etal_2010(zl,rib,zaz0,z0zt) -!this subroutine returns a more robust z/l that best matches -!the z/l from hogstrom (1996) for unstable conditions and beljaars -!and holtslag (1991) for stable conditions. - implicit none -!================================================================================================================= - -!--- input arguments: - real(kind=kind_phys),intent(in):: rib,zaz0,z0zt - -!--- output arguments: - real(kind=kind_phys),intent(out):: zl - -!--- local variables: - real(kind=kind_phys):: alfa,beta,zaz02,z0zt2 - - real(kind=kind_phys),parameter:: au11=0.045, bu11=0.003, bu12=0.0059, & - &bu21=-0.0828, bu22=0.8845, bu31=0.1739, & - &bu32=-0.9213, bu33=-0.1057 - real(kind=kind_phys),parameter:: aw11=0.5738, aw12=-0.4399, aw21=-4.901, & - &aw22=52.50, bw11=-0.0539, bw12=1.540, & - &bw21=-0.669, bw22=-3.282 - real(kind=kind_phys),parameter:: as11=0.7529, as21=14.94, bs11=0.1569, & - &bs21=-0.3091, bs22=-1.303 - -!----------------------------------------------------------------------------------------------------------------- - -!set limits according to Li et al (2010), p 157. - zaz02=zaz0 - if (zaz0 .lt. 100.0) zaz02=100. - if (zaz0 .gt. 100000.0) zaz02=100000. - -!set more limits according to Li et al (2010) - z0zt2=z0zt - if (z0zt .lt. 0.5) z0zt2=0.5 - if (z0zt .gt. 100.0) z0zt2=100. - - alfa = log(zaz02) - beta = log(z0zt2) - - if (rib .le. 0.0) then - zl = au11*alfa*rib**2 + ( & - & (bu11*beta + bu12)*alfa**2 + & - & (bu21*beta + bu22)*alfa + & - & (bu31*beta**2 + bu32*beta + bu33))*rib - - !if(zL .LT. -15 .OR. zl .GT. 0.)print*,"VIOLATION Rib<0:",zL - zl = max(zl,-15.) !limits set according to Li et al (2010) - zl = min(zl,0.) !Figure 1. - elseif (rib .gt. 0.0 .and. rib .le. 0.2) then - zl = ((aw11*beta + aw12)*alfa + & - & (aw21*beta + aw22))*rib**2 + & - & ((bw11*beta + bw12)*alfa + & - & (bw21*beta + bw22))*rib - - !if(zl .lt. 0 .or. zl .gt. 4)print*,"violation 00.2:",zl - zl = min(zl,20.) !limits according to Li et al (2010), their Figure 1c. - zl = max(zl,1.) - endif - - end subroutine li_etal_2010 - -!================================================================================================================= - real(kind=kind_phys) function zolri(ri,za,z0,zt,zol1,psi_opt) - implicit none -! This iterative algorithm is a two-point secant method taken from the revised -! surface layer scheme in WRF-ARW, written by Pedro Jimenez and Jimy Dudhia and -! summarized in Jimenez et al. (2012, MWR). This function was adapted -! to input the thermal roughness length, zt, (as well as z0) and use initial -! estimate of z/L. -!================================================================================================================= - -!--- input arguments: - integer, intent(in):: psi_opt - real(kind=kind_phys),intent(in):: ri,za,z0,zt,zol1 - -!--- local variables and arrays: - integer:: n - integer,parameter:: nmax = 20 - real(kind=kind_phys):: x1,x2,fx1,fx2 - -!----------------------------------------------------------------------------------------------------------------- - - if (ri.lt.0.)then - x1=zol1 - 0.02 !-5. - x2=0. - else - x1=0. - x2=zol1 + 0.02 !5. - endif - - n=0 - fx1=zolri2(x1,ri,za,z0,zt,psi_opt) - fx2=zolri2(x2,ri,za,z0,zt,psi_opt) - - do while (abs(x1 - x2) > 0.01 .and. n < nmax) - if(abs(fx2) .lt. abs(fx1))then - x1=x1-fx1/(fx2-fx1)*(x2-x1) - fx1=zolri2(x1,ri,za,z0,zt,psi_opt) - zolri=x1 - else - x2=x2-fx2/(fx2-fx1)*(x2-x1) - fx2=zolri2(x2,ri,za,z0,zt,psi_opt) - zolri=x2 - endif - n=n+1 - enddo - - if (n==nmax .and. abs(x1 - x2) >= 0.01) then - !if convergence fails, use approximate values: - call li_etal_2010(zolri, ri, za/z0, z0/zt) - !print*,"failed, n=",n," ri=",ri," zt=",zt - else - !print*,"success,n=",n," ri=",ri," z/l=",zolri - endif - - end function zolri - -!================================================================================================================= - real(kind=kind_phys) function zolri2(zol2,ri2,za,z0,zt,psi_opt) - implicit none -! input: ================================= -! zol2 - estimated z/l -! ri2 - calculated bulk richardson number -! za - 1/2 depth of first model layer -! z0 - aerodynamic roughness length -! zt - thermal roughness length -! output: ================================ -! zolri2 - delta ri -!================================================================================================================= - -!--- input arguments: - integer,intent(in):: psi_opt - real(kind=kind_phys),intent(in):: ri2,za,z0,zt - -!--- inout arguments: - real(kind=kind_phys),intent(inout):: zol2 - -!--- local variables and arrays: - real(kind=kind_phys):: zol20,zol3,psim1,psih1,psix2,psit2,zolt - -!----------------------------------------------------------------------------------------------------------------- - - if(zol2*ri2 .lt. 0.) then - !print*,"wrong quadrants: z/l=",zol2," ri=",ri2 - zol2=0. - endif - - zol20=zol2*z0/za ! z0/l - zol3=zol2+zol20 ! (z+z0)/l - zolt=zol2*zt/za ! zt/l - - if (ri2.lt.0) then - psit2=max(log((za+z0)/zt)-(psih_unstable(zol3,psi_opt)-psih_unstable(zolt,psi_opt)), 1.0) - psix2=max(log((za+z0)/z0)-(psim_unstable(zol3,psi_opt)-psim_unstable(zol20,psi_opt)),1.0) - else - psit2=max(log((za+z0)/zt)-(psih_stable(zol3,psi_opt)-psih_stable(zolt,psi_opt)), 1.0) - psix2=max(log((za+z0)/z0)-(psim_stable(zol3,psi_opt)-psim_stable(zol20,psi_opt)),1.0) - endif - - zolri2=zol2*psit2/psix2**2 - ri2 -!print*," target ri=",ri2," est ri=",zol2*psit2/psix2**2 - - end function zolri2 - -!================================================================================================================= - real(kind=kind_phys) function zolrib(ri,za,z0,zt,logz0,logzt,zol1,psi_opt) - implicit none -!this iterative algorithm to compute z/L from bulk-Ri -!================================================================================================================= - -!--- input arguments: - integer,intent(in):: psi_opt - real(kind=kind_phys),intent(in):: ri,za,z0,zt,logz0,logzt - -!--- inout arguments: - real(kind=kind_phys),intent(inout):: zol1 - -!--- local variables and arrays: - integer:: n - integer,parameter :: nmax = 20 - real(kind=kind_phys):: zol20,zol3,zolt,zolold - real(kind=kind_phys):: psit2,psix2 -!real(kind=kind_phys),dimension(nmax):: zlhux - -!----------------------------------------------------------------------------------------------------------------- - - if(zol1*ri .lt. 0.) then -! print*,"WRONG QUADRANTS: z/L=",zol1," ri=",ri - zol1=0. - endif - - if (ri .lt. 0.) then - zolold=-99999. - zolrib=-66666. - else - zolold=99999. - zolrib=66666. - endif - - n=1 - do while (abs(zolold - zolrib) > 0.01 .and. n < nmax) - - if(n==1)then - zolold=zol1 - else - zolold=zolrib - endif - zol20=zolold*z0/za ! z0/L - zol3=zolold+zol20 ! (z+z0)/L - zolt=zolold*zt/za ! zt/L - - if (ri.lt.0) then - psit2=MAX(logzt-(psih_unstable(zol3,psi_opt)-psih_unstable(zolt,psi_opt)), 1.0) - psix2=MAX(logz0-(psim_unstable(zol3,psi_opt)-psim_unstable(zol20,psi_opt)), 1.0) - else - psit2=MAX(logzt-(psih_stable(zol3,psi_opt)-psih_stable(zolt,psi_opt)), 1.0) - psix2=MAX(logz0-(psim_stable(zol3,psi_opt)-psim_stable(zol20,psi_opt)), 1.0) - endif - - zolrib=ri*psix2**2/psit2 - !zLhux(n)=zolrib - n=n+1 - enddo - - if (n==nmax .and. abs(zolold - zolrib) > 0.01 ) then - !print*,"iter FAIL, n=",n," Ri=",ri," z/L=",zolri - !if convergence fails, use approximate values: - call li_etal_2010(zolrib,ri,za/z0,z0/zt) - !zLhux(n)=zolri - !print*,"FAILED, n=",n," Ri=",ri," zt=",zt - !print*,"z/L=",zLhux(1:nmax) - else - !print*,"SUCCESS,n=",n," Ri=",ri," z/L=",zolrib - endif - - end function zolrib - -!================================================================================================================= - subroutine psi_init(psi_opt) - implicit none -!define tables from -10 <= z/L <= 10 -!================================================================================================================= - - integer,intent(in):: psi_opt - integer:: n - real(kind=kind_phys):: zolf - -!----------------------------------------------------------------------------------------------------------------- - - if (psi_opt == 0) then - do n = 0,1000 - !stable function tables - zolf = float(n)*0.01 - psim_stab(n)=psim_stable_full(zolf) - psih_stab(n)=psih_stable_full(zolf) - - !unstable function tables - zolf = -float(n)*0.01 - psim_unstab(n)=psim_unstable_full(zolf) - psih_unstab(n)=psih_unstable_full(zolf) - enddo - else - do n = 0,1000 - !stable function tables - zolf = float(n)*0.01 - psim_stab(n)=psim_stable_full_gfs(zolf) - psih_stab(n)=psih_stable_full_gfs(zolf) - - !unstable function tables - zolf = -float(n)*0.01 - psim_unstab(n)=psim_unstable_full_gfs(zolf) - psih_unstab(n)=psih_unstable_full_gfs(zolf) - enddo - endif - - end subroutine psi_init - -!================================================================================================================= -! ... Full equations for the integrated similarity functions ... -!================================================================================================================= - real(kind=kind_phys) function psim_stable_full(zolf) - implicit none - - real(kind=kind_phys),intent(in):: zolf - - psim_stable_full=-6.1*log(zolf+(1+zolf**2.5)**(1./2.5)) - - end function psim_stable_full - -!================================================================================================================= - real(kind=kind_phys) function psih_stable_full(zolf) - implicit none - - real(kind=kind_phys),intent(in):: zolf - - psih_stable_full=-5.3*log(zolf+(1+zolf**1.1)**(1./1.1)) - - end function psih_stable_full - -!================================================================================================================= - real(kind=kind_phys) function psim_unstable_full(zolf) - implicit none - - real(kind=kind_phys),intent(in):: zolf - real(kind=kind_phys):: x,ym,psimc,psimk - - x=(1.-16.*zolf)**.25 - psimk=2*ALOG(0.5*(1+X))+ALOG(0.5*(1+X*X))-2.*ATAN(X)+2.*ATAN(1.) - - ym=(1.-10.*zolf)**0.33 - psimc=(3./2.)*log((ym**2.+ym+1.)/3.)-sqrt(3.)*ATAN((2.*ym+1)/sqrt(3.))+4.*ATAN(1.)/sqrt(3.) - - psim_unstable_full=(psimk+zolf**2*(psimc))/(1+zolf**2.) - - end function psim_unstable_full - -!================================================================================================================= - real(kind=kind_phys) function psih_unstable_full(zolf) - implicit none - - real(kind=kind_phys),intent(in):: zolf - real(kind=kind_phys):: y,yh,psihc,psihk - - y=(1.-16.*zolf)**.5 - psihk=2.*log((1+y)/2.) - - yh=(1.-34.*zolf)**0.33 - psihc=(3./2.)*log((yh**2.+yh+1.)/3.)-sqrt(3.)*ATAN((2.*yh+1)/sqrt(3.))+4.*ATAN(1.)/sqrt(3.) - - psih_unstable_full=(psihk+zolf**2*(psihc))/(1+zolf**2.) - - end function psih_unstable_full - -!================================================================================================================= -! ... integrated similarity functions from GFS... -! -!================================================================================================================= - real(kind=kind_phys) function psim_stable_full_gfs(zolf) - implicit none - - real(kind=kind_phys),intent(in):: zolf - real(kind=kind_phys):: aa - real(kind=kind_phys),parameter:: alpha4 = 20. - - aa = sqrt(1. + alpha4 * zolf) - psim_stable_full_gfs = -1.*aa + log(aa + 1.) - - end function psim_stable_full_gfs - -!================================================================================================================= - real(kind=kind_phys) function psih_stable_full_gfs(zolf) - implicit none - - real(kind=kind_phys):: zolf - real(kind=kind_phys):: bb - real(kind=kind_phys),parameter:: alpha4 = 20. - - bb = sqrt(1. + alpha4 * zolf) - psih_stable_full_gfs = -1.*bb + log(bb + 1.) - - end function psih_stable_full_gfs - -!================================================================================================================= - real(kind=kind_phys) function psim_unstable_full_gfs(zolf) - implicit none - - real(kind=kind_phys),intent(in):: zolf - real(kind=kind_phys):: hl1,tem1 - real(kind=kind_phys),parameter:: a0=-3.975, a1=12.32, & - b1=-7.755, b2=6.041 - - if (zolf .ge. -0.5) then - hl1 = zolf - psim_unstable_full_gfs = (a0 + a1*hl1) * hl1 / (1.+ (b1+b2*hl1) *hl1) - else - hl1 = -zolf - tem1 = 1.0 / sqrt(hl1) - psim_unstable_full_gfs = log(hl1) + 2. * sqrt(tem1) - .8776 - end if - - end function psim_unstable_full_gfs - -!================================================================================================================= - real(kind=kind_phys) function psih_unstable_full_gfs(zolf) - implicit none - - real(kind=kind_phys),intent(in):: zolf - real(kind=kind_phys):: hl1,tem1 - real(kind=kind_phys),parameter:: a0p=-7.941, a1p=24.75, & - b1p=-8.705, b2p=7.899 - - if (zolf .ge. -0.5) then - hl1 = zolf - psih_unstable_full_gfs = (a0p + a1p*hl1) * hl1 / (1.+ (b1p+b2p*hl1)*hl1) - else - hl1 = -zolf - tem1 = 1.0 / sqrt(hl1) - psih_unstable_full_gfs = log(hl1) + .5 * tem1 + 1.386 - end if - - end function psih_unstable_full_gfs - -!================================================================================================================= -! These functions use the look-up table functions when |z/L| <= 10 -! but default to the full equations when |z/L| > 10. -!================================================================================================================= - real(kind=kind_phys) function psim_stable(zolf,psi_opt) - implicit none - - integer,intent(in):: psi_opt - integer:: nzol - real(kind=kind_phys),intent(in):: zolf - real(kind=kind_phys):: rzol - -!----------------------------------------------------------------------------------------------------------------- - - nzol = int(zolf*100.) - rzol = zolf*100. - nzol - if(nzol+1 .le. 1000)then - psim_stable = psim_stab(nzol) + rzol*(psim_stab(nzol+1)-psim_stab(nzol)) - else - if (psi_opt == 0) then - psim_stable = psim_stable_full(zolf) - else - psim_stable = psim_stable_full_gfs(zolf) - endif - endif - - end function psim_stable - -!================================================================================================================= - real(kind=kind_phys) function psih_stable(zolf,psi_opt) - implicit none - - integer,intent(in):: psi_opt - integer:: nzol - real(kind=kind_phys),intent(in):: zolf - real(kind=kind_phys):: rzol - -!----------------------------------------------------------------------------------------------------------------- - - nzol = int(zolf*100.) - rzol = zolf*100. - nzol - if(nzol+1 .le. 1000)then - psih_stable = psih_stab(nzol) + rzol*(psih_stab(nzol+1)-psih_stab(nzol)) - else - if (psi_opt == 0) then - psih_stable = psih_stable_full(zolf) - else - psih_stable = psih_stable_full_gfs(zolf) - endif - endif - - end function psih_stable - -!================================================================================================================= - real(kind=kind_phys) function psim_unstable(zolf,psi_opt) - implicit none - - integer,intent(in):: psi_opt - integer:: nzol - real(kind=kind_phys),intent(in):: zolf - real(kind=kind_phys):: rzol - -!----------------------------------------------------------------------------------------------------------------- - - nzol = int(-zolf*100.) - rzol = -zolf*100. - nzol - if(nzol+1 .le. 1000)then - psim_unstable = psim_unstab(nzol) + rzol*(psim_unstab(nzol+1)-psim_unstab(nzol)) - else - if (psi_opt == 0) then - psim_unstable = psim_unstable_full(zolf) - else - psim_unstable = psim_unstable_full_gfs(zolf) - endif - endif - - end function psim_unstable - -!================================================================================================================= - real(kind=kind_phys) function psih_unstable(zolf,psi_opt) - implicit none - - integer,intent(in):: psi_opt - integer:: nzol - real(kind=kind_phys),intent(in):: zolf - real(kind=kind_phys):: rzol - -!----------------------------------------------------------------------------------------------------------------- - - nzol = int(-zolf*100.) - rzol = -zolf*100. - nzol - if(nzol+1 .le. 1000)then - psih_unstable = psih_unstab(nzol) + rzol*(psih_unstab(nzol+1)-psih_unstab(nzol)) - else - if (psi_opt == 0) then - psih_unstable = psih_unstable_full(zolf) - else - psih_unstable = psih_unstable_full_gfs(zolf) - endif - endif - - end function psih_unstable - -!================================================================================================================= - end module module_mynnsfclay -!================================================================================================================= - diff --git a/src/core_atmosphere/physics/physics_wrf/module_mynnsfclay_driver.F90 b/src/core_atmosphere/physics/physics_wrf/module_mynnsfclay_driver.F90 deleted file mode 100644 index 1fdee508c7..0000000000 --- a/src/core_atmosphere/physics/physics_wrf/module_mynnsfclay_driver.F90 +++ /dev/null @@ -1,471 +0,0 @@ -!================================================================================================================= - module module_mynnsfclay_driver -!================================================================================================================= - use mpas_kind_types,only: RKIND,StrKIND - - use module_mynnsfclay,only: mynnsfclay - use module_mynnsfclay_pre,only: mynnsfclay_pre - - - implicit none - private - public:: mynnsfclay_driver - - - contains - - -!================================================================================================================= - subroutine mynnsfclay_driver( & - u3d,v3d,t3d,qv3d,p3d,dz8w, & - cp,g,rovcp,r,xlv,psfcpa,chs,chs2,cqs,cqs2,cpm,& - znt,ust,pblh,mavail,zol,mol,regime,psim,psih, & - xland,hfx,qfx,lh,tsk,flhc,flqc,qgh,qsfc,rmol, & - u10,v10,th2,t2,q2,snowh, & - gz1oz0,wspd,br,isfflx,dx, & - svp1,svp2,svp3,svpt0,ep1,ep2, & - karman,itimestep,ch,th3d,pi3d,qc3d,rho3d,qcg, & - spp_pbl,pattern_spp_pbl, & - ustm,ck,cka,cd,cda,isftcflx,iz0tlnd, & - ids,ide,jds,jde,kds,kde, & - ims,ime,jms,jme,kms,kme, & - its,ite,jts,jte,kts,kte, & - restart,cycling,initflag,errmsg,errflg & - ) -!------------------------------------------------------------------- -!-- u3d 3d u-velocity interpolated to theta points (m/s) -!-- v3d 3d v-velocity interpolated to theta points (m/s) -!-- t3d 3d temperature (k) -!-- qv3d 3d water vapor mixing ratio (kg/kg) -!-- p3d 3d pressure (pa) -!-- rho3d 3d density (kg/m3) -!-- dz8w 3d dz between full levels (m) -!-- cp heat capacity at constant pressure for dry air (j/kg/k) -!-- g acceleration due to gravity (m/s^2) -!-- rovcp r/cp -!-- r gas constant for dry air (j/kg/k) -!-- xlv latent heat of vaporization for water (j/kg) -!-- psfcpa surface pressure (pa) -!-- znt roughness length (m) -!-- ust u* in similarity theory (m/s) -!-- ustm u* in similarity theory (m/s) w* added to wspd. this is -! used to couple with tke scheme but not in mynn. -! (as of now, ustm = ust in this version) -!-- pblh pbl height from previous time (m) -!-- mavail surface moisture availability (between 0 and 1) -!-- zol z/l height over monin-obukhov length -!-- mol t* (similarity theory) (k) -!-- rmol reciprocal of m-o length (/m) -!-- regime flag indicating pbl regime (stable, unstable, etc.) -!-- psim similarity stability function for momentum -!-- psih similarity stability function for heat -!-- xland land mask (1 for land, 2 for water) -!-- hfx upward heat flux at the surface (w/m^2) -!-- qfx upward moisture flux at the surface (kg/m^2/s) -!-- lh net upward latent heat flux at surface (w/m^2) -!-- tsk surface temperature (k) -!-- flhc exchange coefficient for heat (w/m^2/k) -!-- flqc exchange coefficient for moisture (kg/m^2/s) -!-- chs heat/moisture exchange coefficient for lsm (m/s) -!-- qgh lowest-level saturated mixing ratio -!-- qsfc qv (specific humidity) at the surface -!-- qsfcmr qv (mixing ratio) at the surface -!-- u10 diagnostic 10m u wind -!-- v10 diagnostic 10m v wind -!-- th2 diagnostic 2m theta (k) -!-- t2 diagnostic 2m temperature (k) -!-- q2 diagnostic 2m mixing ratio (kg/kg) -!-- snowh snow height (m) -!-- gz1oz0 log((z1+znt)/znt) where znt is roughness length -!-- wspd wind speed at lowest model level (m/s) -!-- br bulk richardson number in surface layer -!-- isfflx isfflx=1 for surface heat and moisture fluxes -!-- dx horizontal grid size (m) -!-- svp1 constant for saturation vapor pressure (=0.6112 kpa) -!-- svp2 constant for saturation vapor pressure (=17.67 dimensionless) -!-- svp3 constant for saturation vapor pressure (=29.65 k) -!-- svpt0 constant for saturation vapor pressure (=273.15 k) -!-- ep1 constant for virtual temperature (rv/rd - 1) (dimensionless) -!-- ep2 constant for spec. hum. calc (rd/rv = 0.622) (dimensionless) -!-- ep3 constant for spec. hum. calc (1 - rd/rv = 0.378 ) (dimensionless) -!-- karman von karman constant -!-- ck enthalpy exchange coeff at 10 meters -!-- cd momentum exchange coeff at 10 meters -!-- cka enthalpy exchange coeff at the lowest model level -!-- cda momentum exchange coeff at the lowest model level -!-- isftcflx =0: z0, zt, and zq from coare3.0/3.5 (fairall et al 2003/edson et al 2013) -! (water =1: z0 from davis et al (2008), zt & zq from coare3.0/3.5 -! only) =2: z0 from davis et al (2008), zt & zq from garratt (1992) -! =3: z0 from taylor and yelland (2004), zt and zq from coare 3.0/3.5 -!-- iz0tlnd =0: zilitinkevich (1995) with czil=0.085, -! (land =1: czil_new (modified according to chen & zhang 2008) -! only) =2: modified yang et al (2002, 2008) - generalized for all landuse -! =3: constant zt = z0/7.4 (garratt 1992) -!-- u3d 3d u-velocity interpolated to theta points (m/s) -!-- v3d 3d v-velocity interpolated to theta points (m/s) -!-- t3d 3d temperature (k) -!-- qv3d 3d water vapor mixing ratio (kg/kg) -!-- p3d 3d pressure (pa) -!-- rho3d 3d density (kg/m3) -!-- dz8w 3d dz between full levels (m) -!-- cp heat capacity at constant pressure for dry air (j/kg/k) -!-- g acceleration due to gravity (m/s^2) -!-- rovcp r/cp -!-- r gas constant for dry air (j/kg/k) -!-- xlv latent heat of vaporization for water (j/kg) -!-- psfcpa surface pressure (pa) -!-- znt roughness length (m) -!-- ust u* in similarity theory (m/s) -!-- ustm u* in similarity theory (m/s) w* added to wspd. this is -! used to couple with tke scheme but not in mynn. -! (as of now, ustm = ust in this version) -!-- pblh pbl height from previous time (m) -!-- mavail surface moisture availability (between 0 and 1) -!-- zol z/l height over monin-obukhov length -!-- mol t* (similarity theory) (k) -!-- rmol reciprocal of m-o length (/m) -!-- regime flag indicating pbl regime (stable, unstable, etc.) -!-- psim similarity stability function for momentum -!-- psih similarity stability function for heat -!-- xland land mask (1 for land, 2 for water) -!-- hfx upward heat flux at the surface (w/m^2) -!-- qfx upward moisture flux at the surface (kg/m^2/s) -!-- lh net upward latent heat flux at surface (w/m^2) -!-- tsk surface temperature (k) -!-- flhc exchange coefficient for heat (w/m^2/k) -!-- flqc exchange coefficient for moisture (kg/m^2/s) -!-- chs heat/moisture exchange coefficient for lsm (m/s) -!-- qgh lowest-level saturated mixing ratio -!-- qsfc qv (specific humidity) at the surface -!-- qsfcmr qv (mixing ratio) at the surface -!-- u10 diagnostic 10m u wind -!-- v10 diagnostic 10m v wind -!-- th2 diagnostic 2m theta (k) -!-- t2 diagnostic 2m temperature (k) -!-- q2 diagnostic 2m mixing ratio (kg/kg) -!-- snowh snow height (m) -!-- gz1oz0 log((z1+znt)/znt) where znt is roughness length -!-- wspd wind speed at lowest model level (m/s) -!-- br bulk richardson number in surface layer -!-- isfflx isfflx=1 for surface heat and moisture fluxes -!-- dx horizontal grid size (m) -!-- svp1 constant for saturation vapor pressure (=0.6112 kpa) -!-- svp2 constant for saturation vapor pressure (=17.67 dimensionless) -!-- svp3 constant for saturation vapor pressure (=29.65 k) -!-- svpt0 constant for saturation vapor pressure (=273.15 k) -!-- ep1 constant for virtual temperature (rv/rd - 1) (dimensionless) -!-- ep2 constant for spec. hum. calc (rd/rv = 0.622) (dimensionless) -!-- ep3 constant for spec. hum. calc (1 - rd/rv = 0.378 ) (dimensionless) -!-- karman von karman constant -!-- ck enthalpy exchange coeff at 10 meters -!-- cd momentum exchange coeff at 10 meters -!-- cka enthalpy exchange coeff at the lowest model level -!-- cda momentum exchange coeff at the lowest model level -!-- isftcflx =0: z0, zt, and zq from coare3.0/3.5 (fairall et al 2003/edson et al 2013) -! (water =1: z0 from davis et al (2008), zt & zq from coare3.0/3.5 -! only) =2: z0 from davis et al (2008), zt & zq from garratt (1992) -! =3: z0 from taylor and yelland (2004), zt and zq from coare 3.0/3.5 -!-- iz0tlnd =0: zilitinkevich (1995) with czil=0.085, -! (land =1: czil_new (modified according to chen & zhang 2008) -! only) =2: modified yang et al (2002, 2008) - generalized for all landuse -! =3: constant zt = z0/7.4 (garratt 1992) -! -!-- ids start index for i in domain -!-- ide end index for i in domain -!-- jds start index for j in domain -!-- jde end index for j in domain -!-- kds start index for k in domain -!-- kde end index for k in domain -!-- ims start index for i in memory -!-- ime end index for i in memory -!-- jms start index for j in memory -!-- jme end index for j in memory -!-- kms start index for k in memory -!-- kme end index for k in memory -!-- its start index for i in tile -!-- ite end index for i in tile -!-- jts start index for j in tile -!-- jte end index for j in tile -!-- kts start index for k in tile -!-- kte end index for k in tile -!================================================================================================================= - -!--- input arguments: - integer,intent(in):: ids,ide,jds,jde,kds,kde, & - ims,ime,jms,jme,kms,kme, & - its,ite,jts,jte,kts,kte - logical,intent(in):: restart,cycling - integer,intent(in):: itimestep - integer,intent(in):: initflag - integer,intent(in):: isfflx - integer,intent(in),optional:: isftcflx, iz0tlnd - integer,intent(in),optional:: spp_pbl - - real(kind=RKIND),intent(in):: svp1,svp2,svp3,svpt0 - real(kind=RKIND),intent(in):: ep1,ep2,karman - real(kind=RKIND),intent(in):: cp,g,rovcp,r,xlv - - real(kind=RKIND),intent(in),dimension(ims:ime,kms:kme,jms:jme):: & - dz8w, & - qv3d, & - p3d, & - t3d, & - qc3d, & - u3d, & - v3d, & - rho3d, & - th3d, & - pi3d - - real(kind=RKIND),intent(in),dimension(ims:ime,kms:kme,jms:jme),optional:: & - pattern_spp_pbl - - real(kind=RKIND),intent(in),dimension(ims:ime,jms:jme):: & - mavail, & - pblh, & - xland, & - tsk, & - qcg, & - psfcpa, & - snowh, & - dx - -!--- output arguments: - character(len=StrKIND),intent(out):: errmsg - integer,intent(out):: errflg - - real(kind=RKIND),intent(out),dimension(ims:ime,jms:jme):: & - u10, & - v10, & - th2, & - t2, & - q2 - - real(kind=RKIND),intent(out),dimension(ims:ime,jms:jme),optional:: & - ck, & - cka, & - cd, & - cda, & - ustm - -!--- inout arguments: - real(kind=RKIND),intent(inout),dimension(ims:ime,jms:jme):: & - regime, & - hfx, & - qfx, & - lh, & - mol, & - rmol, & - qsfc, & - qgh, & - znt, & - zol, & - ust, & - cpm, & - chs2, & - cqs2, & - cqs, & - chs, & - ch, & - flhc, & - flqc, & - gz1oz0, & - wspd, & - br, & - psim, & - psih - -!--- local variables and arrays: - integer:: i,j,k - logical:: restart_or_cycle - - real(kind=RKIND),dimension(its:ite):: & - u1d,v1d,u1d2,v1d2,qv1d,p1d,t1d,qc1d,rho1d,dz8w1d,dz2w1d - - real(kind=RKIND),dimension(its:ite):: rstoch1d - - real(kind=RKIND),dimension(ims:ime,jms:jme):: qstar,wstar - -!intermediate variables and arrays to accomodate the CCPP-compliant sourcecode: - logical:: f_spp - - real(kind=RKIND),dimension(its:ite):: mavail_hv,pblh_hv,xland_hv,tsk_hv,psfcpa_hv, & - qcg_hv,snowh_hv,dx_hv - real(kind=RKIND),dimension(its:ite):: regime_hv,hfx_hv,qfx_hv,lh_hv,mol_hv,rmol_hv, & - qgh_hv,qsfc_hv,znt_hv,zol_hv,ust_hv,cpm_hv,chs2_hv, & - cqs_hv,cqs2_hv,chs_hv,ch_hv,flhc_hv,flqc_hv,gz1oz0_hv, & - wspd_hv,br_hv,psim_hv,psih_hv - real(kind=RKIND),dimension(its:ite):: u10_hv,v10_hv,th2_hv,t2_hv,q2_hv,wstar_hv,qstar_hv - real(kind=RKIND),dimension(its:ite):: cd_hv,cda_hv,ck_hv,cka_hv,ustm_hv - -!----------------------------------------------------------------------------------------------------------------- - - f_spp = .false. - if(spp_pbl==1 .and. present(pattern_spp_pbl)) f_spp = .true. - restart_or_cycle = .false. - if(restart .or. cycling)restart_or_cycle=.true. - - errmsg = ' ' - errflg = 0 - - do j = jts,jte - - !initialization of arrays ust,mol,qsfc,and qstar that are initialized if itimestep equals 1: - do i = its,ite - ust_hv(i) = ust(i,j) - mol_hv(i) = mol(i,j) - qsfc_hv(i) = qsfc(i,j) - qstar_hv(i) = qstar(i,j) - enddo - - call mynnsfclay_pre(its,ite,kte,initflag,dz8w,u3d,v3d,p3d,t3d,rho3d,qv3d,qc3d,f_spp, & - pattern_spp_pbl,ust_hv,mol_hv,qsfc_hv,qstar_hv,dz8w1d,u1d,v1d,p1d,t1d,rho1d,& - qv1d,qc1d,rstoch1d,dz2w1d,u1d2,v1d2,errmsg,errflg) - - !input arguments: - do i = its,ite - mavail_hv(i) = mavail(i,j) - pblh_hv(i) = pblh(i,j) - xland_hv(i) = xland(i,j) - tsk_hv(i) = tsk(i,j) - psfcpa_hv(i) = psfcpa(i,j) - qcg_hv(i) = qcg(i,j) - snowh_hv(i) = snowh(i,j) - dx_hv(i) = dx(i,j) - enddo - - !inout arguments: - do i = its,ite - regime_hv(i) = regime(i,j) - hfx_hv(i) = hfx(i,j) - qfx_hv(i) = qfx(i,j) - lh_hv(i) = lh(i,j) - rmol_hv(i) = rmol(i,j) - qgh_hv(i) = qgh(i,j) - znt_hv(i) = znt(i,j) - zol_hv(i) = zol(i,j) - cpm_hv(i) = cpm(i,j) - chs2_hv(i) = chs2(i,j) - cqs2_hv(i) = cqs2(i,j) - cqs_hv(i) = cqs(i,j) - chs_hv(i) = chs(i,j) - ch_hv(i) = ch(i,j) - flhc_hv(i) = flhc(i,j) - flqc_hv(i) = flqc(i,j) - gz1oz0_hv(i) = gz1oz0(i,j) - wspd_hv(i) = wspd(i,j) - br_hv(i) = br(i,j) - psim_hv(i) = psim(i,j) - psih_hv(i) = psih(i,j) - enddo - - !output arguments: - do i = its,ite - u10_hv(i) = 0. - v10_hv(i) = 0. - th2_hv(i) = 0. - t2_hv(i) = 0. - q2_hv(i) = 0. - wstar_hv(i) = 0. - enddo - - !optional output arguments: - if(present(ck) .and. present(cka) .and. present(cd) .and. present(cda)) then - do i = its,ite - ck_hv(i) = 0. - cka_hv(i) = 0. - cd_hv(i) = 0. - cda_hv(i) = 0. - enddo - endif - if(present(ustm)) then - do i = its,ite - ustm_hv(i) = ustm(i,j) - enddo - endif - - call mynnsfclay( & - u1d = u1d , v1d = v1d , t1d = t1d , qv1d = qv1d , & - p1d = p1d , dz8w1d = dz8w1d , rho1d = rho1d , u1d2 = u1d2 , & - v1d2 = v1d2 , dz2w1d = dz2w1d , cp = cp , g = g , & - rovcp = rovcp , r = r , xlv = xlv , psfcpa = psfcpa_hv , & - cpm = cpm_hv , & - chs = chs_hv , chs2 = chs2_hv , cqs2 = cqs2_hv , cqs = cqs_hv , & - pblh = pblh_hv , rmol = rmol_hv , znt = znt_hv , ust = ust_hv , & - mavail = mavail_hv , zol = zol_hv , mol = mol_hv , regime = regime_hv , & - psim = psim_hv , psih = psih_hv , xland = xland_hv , hfx = hfx_hv , & - qfx = qfx_hv , tsk = tsk_hv , u10 = u10_hv , v10 = v10_hv , & - th2 = th2_hv , t2 = t2_hv , q2 = q2_hv , flhc = flhc_hv , & - flqc = flqc_hv , snowh = snowh_hv , qgh = qgh_hv , qsfc = qsfc_hv , & - lh = lh_hv , gz1oz0 = gz1oz0_hv , wspd = wspd_hv , br = br_hv , & - isfflx = isfflx , dx = dx_hv , svp1 = svp1 , svp2 = svp2 , & - svp3 = svp3 , svpt0 = svpt0 , ep1 = ep1 , ep2 = ep2 , & - karman = karman , ch = ch_hv , qcg = qcg_hv , itimestep = itimestep , & - wstar = wstar_hv , qstar = qstar_hv , ustm = ustm_hv , ck = ck_hv , & - cka = cka_hv , cd = cd_hv , cda = cda_hv , spp_pbl = f_spp , & - rstoch1d = rstoch1d , isftcflx = isftcflx , iz0tlnd = iz0tlnd , & - its = its , ite = ite , restart_or_cycle = restart_or_cycle , & - errmsg = errmsg , errflg = errflg & - ) - - !inout arguments: - do i = its,ite - regime(i,j) = regime_hv(i) - hfx(i,j) = hfx_hv(i) - qfx(i,j) = qfx_hv(i) - lh(i,j) = lh_hv(i) - mol(i,j) = mol_hv(i) - rmol(i,j) = rmol_hv(i) - qgh(i,j) = qgh_hv(i) - qsfc(i,j) = qsfc_hv(i) - znt(i,j) = znt_hv(i) - zol(i,j) = zol_hv(i) - ust(i,j) = ust_hv(i) - cpm(i,j) = cpm_hv(i) - chs2(i,j) = chs2_hv(i) - cqs2(i,j) = cqs2_hv(i) - cqs(i,j) = cqs_hv(i) - chs(i,j) = chs_hv(i) - ch(i,j) = ch_hv(i) - flhc(i,j) = flhc_hv(i) - flqc(i,j) = flqc_hv(i) - gz1oz0(i,j) = gz1oz0_hv(i) - wspd(i,j) = wspd_hv(i) - br(i,j) = br_hv(i) - psim(i,j) = psim_hv(i) - psih(i,j) = psih_hv(i) - enddo - - !output arguments: - do i = its,ite - u10(i,j) = u10_hv(i) - v10(i,j) = v10_hv(i) - th2(i,j) = th2_hv(i) - t2(i,j) = t2_hv(i) - q2(i,j) = q2_hv(i) - wstar(i,j) = wstar_hv(i) - qstar(i,j) = qstar_hv(i) - enddo - - !optional output arguments: - if(present(ck) .and. present(cka) .and. present(cd) .and. present(cda)) then - do i = its,ite - ck(i,j) = ck_hv(i) - cka(i,j) = cka_hv(i) - cd(i,j) = cd_hv(i) - cda(i,j) = cda_hv(i) - enddo - endif - if(present(ustm)) then - do i = its,ite - ustm(i,j) = ustm_hv(i) - enddo - endif - - enddo - - end subroutine mynnsfclay_driver - -!================================================================================================================= - end module module_mynnsfclay_driver -!================================================================================================================= diff --git a/src/core_atmosphere/physics/physics_wrf/module_mynnsfclay_pre.F90 b/src/core_atmosphere/physics/physics_wrf/module_mynnsfclay_pre.F90 deleted file mode 100644 index be8eae81fb..0000000000 --- a/src/core_atmosphere/physics/physics_wrf/module_mynnsfclay_pre.F90 +++ /dev/null @@ -1,174 +0,0 @@ -!================================================================================================================= - module module_mynnsfclay_pre - use ccpp_kind_types,only: kind_phys - - implicit none - private - public:: mynnsfclay_pre_init, & - mynnsfclay_pre_finalize, & - mynnsfclay_pre - - - contains - -!================================================================================================================= -!>\section arg_table_sf_mynn_pre_init -!!\html\include sf_mynn_pre_init.html -!! - subroutine mynnsfclay_pre_init(errmsg,errflg) -!================================================================================================================= - -!--- output arguments: - character(len=*),intent(out):: & - errmsg ! output error message (-). - - integer,intent(out):: & - errflg ! output error flag (-). - -!----------------------------------------------------------------------------------------------------------------- - -!--- output error flag and message: - errflg = 0 - errmsg = " " - - end subroutine mynnsfclay_pre_init - -!================================================================================================================= -!>\section arg_table_sf_mynn_pre_finalize -!!\html\include sf_mynn_pre_finalize.html -!! - subroutine mynnsfclay_pre_finalize(errmsg,errflg) -!================================================================================================================= - -!--- output arguments: - character(len=*),intent(out):: & - errmsg ! output error message (-). - - integer,intent(out):: & - errflg ! output error flag (-). - -!----------------------------------------------------------------------------------------------------------------- - -!--- output error flag and message: - errflg = 0 - errmsg = " " - - end subroutine mynnsfclay_pre_finalize - -!================================================================================================================= -!>\section arg_table_sf_mynn_pre_run -!!\html\include sf_mynn_pre_run.html -!! - subroutine mynnsfclay_pre(its,ite,kte,initflag,dz3d,u3d,v3d,p3d,t3d,rho3d,qv3d,qc3d,f_spp,pattern_spp, & - ust,mol,qsfc,qstar,dz8w1d,u1d,v1d,p1d,t1d,rho1d,qv1d,qc1d,rstoch1d,dz2w1d,u1d2, & - v1d2,errmsg,errflg) -!================================================================================================================= - -!--- input arguments: - logical,intent(in):: f_spp - - integer,intent(in):: its,ite - integer,intent(in):: kte - integer,intent(in):: initflag - - real(kind=kind_phys),intent(in),dimension(its:ite,1:kte):: & - dz3d, &! - u3d, &! - v3d, &! - qv3d, &! - qc3d, &! - p3d, &! - t3d, &! - rho3d ! - - real(kind=kind_phys),intent(in),dimension(its:ite,1:kte):: & - pattern_spp ! - - -!--- inout arguments: - real(kind=kind_phys),intent(inout),dimension(its:ite):: & - ust, &! - mol, &! - qsfc, &! - qstar ! - - -!--- output arguments: - character(len=*),intent(out):: & - errmsg ! output error message (-). - - integer,intent(out):: & - errflg ! output error flag (-). - - real(kind=kind_phys),intent(out),dimension(its:ite):: & - dz8w1d, &! - u1d, &! - v1d, &! - qv1d, &! - qc1d, &! - p1d, &! - t1d, &! - rho1d, &! - rstoch1d ! - - real(kind=kind_phys),intent(out),dimension(its:ite):: & - dz2w1d, &! - u1d2, &! - v1d2 ! - - -!--- local variables: - integer:: i,kts - -!----------------------------------------------------------------------------------------------------------------- - - kts = 1 - - do i = its,ite - dz8w1d(i) = dz3d(i,kts) - u1d(i) = u3d(i,kts) - v1d(i) = v3d(i,kts) - qv1d(i) = qv3d(i,kts) - qc1d(i) = qc3d(i,kts) - p1d(i) = p3d(i,kts) - t1d(i) = t3d(i,kts) - rho1d(i) = rho3d(i,kts) - !--- 2nd model level winds - for diags with high-resolution grids: - dz2w1d(i) = dz3d(i,kts+1) - u1d2(i) = u3d(i,kts+1) - v1d2(i) = v3d(i,kts+1) - enddo - - if(f_spp) then - do i = its,ite - rstoch1d(i) = pattern_spp(i,kts) - enddo - else - do i = its,ite - rstoch1d(i)=0._kind_phys - enddo - endif - - if(initflag == 1) then - do i = its,ite - if (ust(i) .lt. 1e-4 .or. ust(i) .gt. 3.0) then - ust(i) = max(0.04*sqrt(u1d(i)*u1d(i) + v1d(i)*v1d(i)),0.001) - endif - !qfx(i) = 0._kind_phy - !hfx(i) = 0._kind_phy - mol(i) = 0._kind_phys - !qsfc(i) = qv1d(i)/(1.+qv1d(i)) - qsfc(i) = qsfc(i) !should be available - qstar(i) = 0._kind_phys - enddo - endif - -!--- output message and error flags: - errmsg = 'sf_mynn_mpas_run OK' - errflg = 0 - - end subroutine mynnsfclay_pre - -!================================================================================================================= - end module module_mynnsfclay_pre -!================================================================================================================= diff --git a/src/core_atmosphere/utils/Makefile b/src/core_atmosphere/utils/Makefile index cf4e2fd172..ede5830d5a 100644 --- a/src/core_atmosphere/utils/Makefile +++ b/src/core_atmosphere/utils/Makefile @@ -4,27 +4,15 @@ ifdef PHYSICS UTILS = build_tables endif -all: $(UTILS) build_tables_tempo +all: $(UTILS) build_tables: build_tables.o atmphys_build_tables_thompson.o $(LINKER) $(LDFLAGS) -o build_tables build_tables.o atmphys_build_tables_thompson.o -L../../framework -L../physics -lphys -lframework $(LIBS) -L../../external/esmf_time_f90 -lesmf_time mv build_tables ../../.. -build_tables_tempo: build_tables_tempo.o atmphys_build_tables_tempo.o - $(LINKER) $(LDFLAGS) -o build_tables_tempo build_tables_tempo.o atmphys_build_tables_tempo.o -L../../framework -L../physics -lphys -lframework $(LIBS) -L../../external/esmf_time_f90 -lesmf_time - mv build_tables_tempo ../../.. - build_tables.o: \ atmphys_build_tables_thompson.o -build_tables_tempo.o: \ - atmphys_build_tables_tempo.o - -atmphys_build_tables_tempo.o: \ - ../physics/physics_noaa/TEMPO/module_mp_tempo.o \ - ../physics/physics_noaa/TEMPO/module_mp_tempo_utils.o \ - ../physics/physics_noaa/TEMPO/module_mp_tempo_params.o - clean: $(RM) ../../../build_tables $(RM) *.o *.mod *.f90 diff --git a/src/core_init_atmosphere/Registry.xml b/src/core_init_atmosphere/Registry.xml index d850b94cae..ccf2185f25 100644 --- a/src/core_init_atmosphere/Registry.xml +++ b/src/core_init_atmosphere/Registry.xml @@ -214,7 +214,7 @@ description="The supersampling factor to be used for MODIS maximum snow albedo and monthly albedo datasets (case 7 only)" possible_values="Positive integer values"/> - @@ -234,7 +234,7 @@ description="Whether to use specific-humidity as the first-guess moisture variable. If this option is False, relative humidity will be used." possible_values="true or false"/> - @@ -325,12 +325,7 @@ description="Whether to interpolate first-guess fields from intermediate file" possible_values="true or false"/> - - - @@ -352,6 +347,20 @@ possible_values="Positive real values"/> + + + + + + + + - - - + + + + @@ -891,7 +901,7 @@ - - + description="Hail mixing ratio"/> @@ -1250,6 +1260,9 @@ + + @@ -1287,57 +1300,72 @@ description="Water vapor mixing ratio on lateral boundary cells"/> + description="Cloud water mixing ratio on lateral boundary cells" + packages="lbc_hydrometeors_rrfs;lbc_hydrometeors_gfs"/> + description="Rain water mixing ratio on lateral boundary cells" + packages="lbc_hydrometeors_rrfs;lbc_hydrometeors_gfs"/> + description="Lateral boundary tendency of ice mixing ratio" + packages="lbc_hydrometeors_rrfs;lbc_hydrometeors_gfs"/> + description="Lateral boundary tendency of snow mixing ratio" + packages="lbc_hydrometeors_rrfs;lbc_hydrometeors_gfs"/> + description="Lateral boundary tendency of graupel mixing ratio" + packages="lbc_hydrometeors_rrfs;lbc_hydrometeors_gfs"/> - + + description="Lateral boundary tendency of rain number concentration" + packages="lbc_hydrometeors_rrfs"/> + description="Lateral boundary tendency of ice number concentration" + packages="lbc_hydrometeors_rrfs"/> + description="Lateral boundary tendency of droplet number concentration" + packages="lbc_hydrometeors_rrfs"/> + description="Lateral boundary tendency of snow number concentration" + packages="lbc_hydrometeors_rrfs"/> + description="Lateral boundary tendency of graupel number concentration" + packages="lbc_hydrometeors_rrfs"/> + description="Lateral boundary tendency of hail number concentration" + packages="lbc_hydrometeors_rrfs"/> + description="Lateral boundary tendency of CCN number concentration" + packages="lbc_hydrometeors_rrfs"/> + description="Lateral boundary tendency of graupel particle volume" + packages="lbc_hydrometeors_rrfs"/> + description="Lateral boundary tendency of hail particle volume" + packages="lbc_hydrometeors_rrfs"/> + packages="mp_thompson_aers_in;tempo_aerosolaware_in;lbc_hydrometeors_rrfs"/> + packages="mp_thompson_aers_in;tempo_aerosolaware_in;lbc_hydrometeors_rrfs"/> @@ -1373,11 +1401,11 @@ description="First guess specific humidity" packages="first_guess_field"/> - + - + @@ -1504,9 +1532,9 @@ description="vegetation fraction" packages="met_stage_out"/> - + - + #include "registry.chemistry.xml" diff --git a/src/core_init_atmosphere/mpas_init_atm_cases.F b/src/core_init_atmosphere/mpas_init_atm_cases.F index 6dbd7f158a..8db4722f55 100644 --- a/src/core_init_atmosphere/mpas_init_atm_cases.F +++ b/src/core_init_atmosphere/mpas_init_atm_cases.F @@ -70,7 +70,6 @@ subroutine init_atm_setup_case(domain, stream_manager) logical, pointer :: config_native_gwd_static logical, pointer :: config_native_gwd_gsl_static logical, pointer :: config_met_interp - logical, pointer :: config_aerosol_climo logical, pointer :: config_blend_bdy_terrain character (len=StrKIND), pointer :: config_start_time character (len=StrKIND), pointer :: config_met_prefix @@ -232,7 +231,6 @@ subroutine init_atm_setup_case(domain, stream_manager) call mpas_pool_get_config(block_ptr % configs, 'config_native_gwd_static', config_native_gwd_static) call mpas_pool_get_config(block_ptr % configs, 'config_native_gwd_gsl_static', config_native_gwd_gsl_static) call mpas_pool_get_config(block_ptr % configs, 'config_met_interp', config_met_interp) - call mpas_pool_get_config(block_ptr % configs, 'config_aerosol_climo', config_aerosol_climo) call mpas_pool_get_config(block_ptr % configs, 'config_blend_bdy_terrain', config_blend_bdy_terrain) call mpas_pool_get_subpool(block_ptr % structs, 'mesh', mesh) @@ -397,8 +395,6 @@ subroutine init_atm_setup_case(domain, stream_manager) call mpas_pool_get_dimension(block_ptr % dimensions, 'nEdges', nEdges) call mpas_pool_get_dimension(block_ptr % dimensions, 'nVertLevels', nVertLevels) - call mpas_pool_get_config(block_ptr % configs, 'config_aerosol_climo', config_aerosol_climo) - call mpas_get_time(curr_time, dateTimeString=timeString) xtime = timeString ! Set field valid time, xtime, to the current time in the time loop time_since_start = curr_time - start_time diff --git a/src/framework/mpas_stream_manager.F b/src/framework/mpas_stream_manager.F index d21dd04e4f..b194a98a69 100644 --- a/src/framework/mpas_stream_manager.F +++ b/src/framework/mpas_stream_manager.F @@ -163,7 +163,7 @@ end subroutine seed_random if (err_local /= MPAS_STREAM_LIST_NOERR) then if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR STREAM_ERROR_WRITE('Problems while creating stream list') - return + return end if ! @@ -173,7 +173,7 @@ end subroutine seed_random if (err_local /= MPAS_STREAM_LIST_NOERR) then if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR STREAM_ERROR_WRITE('Problems while creating input alarm list') - return + return end if ! @@ -183,7 +183,7 @@ end subroutine seed_random if (err_local /= MPAS_STREAM_LIST_NOERR) then if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR STREAM_ERROR_WRITE('Problems while creating output alarm list') - return + return end if ! @@ -221,7 +221,7 @@ subroutine MPAS_stream_mgr_finalize(manager, ierr)!{{{ threadNum = mpas_threading_get_thread_num() - STREAM_DEBUG_WRITE('-- Called MPAS_stream_mgr_finalize()') + STREAM_DEBUG_WRITE('-- Called MPAS_stream_mgr_finalize()') if (present(ierr)) ierr = MPAS_STREAM_MGR_NOERR @@ -281,16 +281,16 @@ end subroutine MPAS_stream_mgr_finalize!}}} !> \author Michael Duda, Doug Jacobsen !> \date 13 June 2014 !> \details - !> Creates a new stream within the stream manager. The "direction" - !> argument may be either MPAS_STREAM_INPUT, MPAS_STREAM_OUTPUT, - !> MPAS_STREAM_INPUT_OUTPUT, or MPAS_STREAM_NONE. The "filename" argument - !> is the template of the filenames that are associated with the stream. - !> Knowing the interval between files, and - !> the filename template, a "referenceTime" argument must be provided to - !> specify the first timestamp appearing in any of the files associated with - !> the stream, thereby determining where the "file breaks" will occur between - !> timestamps. If no "referenceTime" is specified, the start time of the - !> clock associated with the stream handler will be used as the reference + !> Creates a new stream within the stream manager. The "direction" + !> argument may be either MPAS_STREAM_INPUT, MPAS_STREAM_OUTPUT, + !> MPAS_STREAM_INPUT_OUTPUT, or MPAS_STREAM_NONE. The "filename" argument + !> is the template of the filenames that are associated with the stream. + !> Knowing the interval between files, and + !> the filename template, a "referenceTime" argument must be provided to + !> specify the first timestamp appearing in any of the files associated with + !> the stream, thereby determining where the "file breaks" will occur between + !> timestamps. If no "referenceTime" is specified, the start time of the + !> clock associated with the stream handler will be used as the reference !> time. Additionally, the interval between records in the file may be !> specified using the optional "recordInterval" argument; if this argument !> is not supplied, the stream manager will assume that this interval is @@ -301,8 +301,8 @@ end subroutine MPAS_stream_mgr_finalize!}}} !> MPAS_IO_DOUBLE_PRECISION, or MPAS_IO_NATIVE_PRECISION; if this argument is !> not supplied, native precision is assumed. !> The optional argument clobberMode determines how the stream manager will - !> deal with existing files; possible options include MPAS_STREAM_CLOBBER_NEVER, - !> MPAS_STREAM_CLOBBER_APPEND, MPAS_STREAM_CLOBBER_TRUNCATE, + !> deal with existing files; possible options include MPAS_STREAM_CLOBBER_NEVER, + !> MPAS_STREAM_CLOBBER_APPEND, MPAS_STREAM_CLOBBER_TRUNCATE, !> and MPAS_STREAM_CLOBBER_OVERWRITE. The default behavior is to never modify !> existing files (MPAS_STREAM_CLOBBER_NEVER). !> The optional argument ioType specifies the I/O type to use for the @@ -408,14 +408,14 @@ subroutine MPAS_stream_mgr_create_stream(manager, streamID, direction, filename, if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR STREAM_ERROR_WRITE('Problems while creating input alarm list') deallocate(new_stream) - return + return end if call MPAS_stream_list_create(new_stream % alarmList_out, ierr=err_local) if (err_local /= MPAS_STREAM_LIST_NOERR) then if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR STREAM_ERROR_WRITE('Problems while creating output alarm list') deallocate(new_stream) - return + return end if call mpas_pool_create_pool(new_stream % att_pool) call mpas_pool_clone_pool(manager % defaultAtts, new_stream % att_pool) @@ -434,7 +434,7 @@ subroutine MPAS_stream_mgr_create_stream(manager, streamID, direction, filename, STREAM_ERROR_WRITE('Problems while adding stream to list') return end if - + manager % numStreams = manager % numStreams + 1 end if @@ -645,7 +645,7 @@ subroutine MPAS_stream_mgr_destroy_stream(manager, streamID, ierr)!{{{ deallocate(stream % stream) end if deallocate(stream) - + manager % numStreams = manager % numStreams - 1 end if @@ -659,8 +659,8 @@ end subroutine MPAS_stream_mgr_destroy_stream!}}} !> \author Michael Duda !> \date 22 August 2014 !> \details - !> Returns a pointer to the clock associated with the stream manager, - !> in which any stream alarms should be defined before being added to + !> Returns a pointer to the clock associated with the stream manager, + !> in which any stream alarms should be defined before being added to !> the stream manager via the MPAS_stream_mgr_add_alarm() routine. ! !----------------------------------------------------------------------- @@ -1082,7 +1082,7 @@ end subroutine MPAS_stream_mgr_add_stream_fields!}}} ! !----------------------------------------------------------------------- subroutine MPAS_stream_mgr_remove_field(manager, streamID, fieldName, ierr)!{{{ - + implicit none character (len=*), parameter :: sub = 'MPAS_stream_mgr_remove_field' @@ -1242,7 +1242,7 @@ subroutine MPAS_stream_mgr_add_alarm(manager, streamID, alarmID, direction, ierr ! if ( threadNum == 0 ) then if (direction == MPAS_STREAM_INPUT .or. direction == MPAS_STREAM_INPUT_OUTPUT) then - + ! If alarm is not already defined, we need to create a new alarm node nullify(new_alarm) if (.not. MPAS_stream_list_query(manager % alarms_in, alarmID, new_alarm, ierr=err_local)) then @@ -1252,10 +1252,10 @@ subroutine MPAS_stream_mgr_add_alarm(manager, streamID, alarmID, direction, ierr if (err_local /= MPAS_STREAM_LIST_NOERR) then if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR STREAM_ERROR_WRITE('Problems while creating stream list for alarm') - return + return end if nullify(new_alarm % next) - + call MPAS_stream_list_insert(manager % alarms_in, new_alarm, ierr=err_local) if (err_local /= MPAS_STREAM_LIST_NOERR) then if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR @@ -1263,7 +1263,7 @@ subroutine MPAS_stream_mgr_add_alarm(manager, streamID, alarmID, direction, ierr return end if end if - + ! Add specified stream to alarm node stream list allocate(new_xref) new_xref % name = streamID @@ -1274,7 +1274,7 @@ subroutine MPAS_stream_mgr_add_alarm(manager, streamID, alarmID, direction, ierr STREAM_ERROR_WRITE('Problems while adding stream to alarm stream list') return end if - + ! Add alarm to stream alarm list allocate(new_xref) new_xref % name = alarmID @@ -1286,9 +1286,9 @@ subroutine MPAS_stream_mgr_add_alarm(manager, streamID, alarmID, direction, ierr return end if end if - + if (direction == MPAS_STREAM_OUTPUT .or. direction == MPAS_STREAM_INPUT_OUTPUT) then - + ! If alarm is not already defined, we need to create a new alarm node nullify(new_alarm) if (.not. MPAS_stream_list_query(manager % alarms_out, alarmID, new_alarm, ierr=err_local)) then @@ -1298,10 +1298,10 @@ subroutine MPAS_stream_mgr_add_alarm(manager, streamID, alarmID, direction, ierr if (err_local /= MPAS_STREAM_LIST_NOERR) then if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR STREAM_ERROR_WRITE('Problems while creating stream list for alarm') - return + return end if nullify(new_alarm % next) - + call MPAS_stream_list_insert(manager % alarms_out, new_alarm, ierr=err_local) if (err_local /= MPAS_STREAM_LIST_NOERR) then if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR @@ -1309,7 +1309,7 @@ subroutine MPAS_stream_mgr_add_alarm(manager, streamID, alarmID, direction, ierr return end if end if - + ! Add specified stream to alarm node stream list allocate(new_xref) new_xref % name = streamID @@ -1320,7 +1320,7 @@ subroutine MPAS_stream_mgr_add_alarm(manager, streamID, alarmID, direction, ierr STREAM_ERROR_WRITE('Problems while adding stream to alarm stream list') return end if - + ! Add alarm to stream alarm list allocate(new_xref) new_xref % name = alarmID @@ -1409,7 +1409,7 @@ subroutine MPAS_stream_mgr_remove_alarm(manager, streamID, alarmID, direction, i STREAM_ERROR_WRITE('Output alarm '//trim(alarmID)//' does not exist on stream '//trim(streamID)) end if return - end if + end if if (.not. associated(streamNode)) then if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR STREAM_ERROR_WRITE('Alarm '//trim(alarmID)//' does not have stream '//trim(streamID)//' on its stream list.') @@ -1443,7 +1443,7 @@ end subroutine MPAS_stream_mgr_remove_alarm!}}} !> Resets all alarms used by the stream manager. If the optional argument !> 'streamID' is provided, only alarms associated with streams that match !> the 'streamID' regular expression will be - !> reset. If the optional 'direction' argument is provided, only alarms + !> reset. If the optional 'direction' argument is provided, only alarms !> associated with that direction will be reset. ! !----------------------------------------------------------------------- @@ -1463,7 +1463,7 @@ subroutine MPAS_stream_mgr_reset_alarms(manager, streamID, direction, ierr)!{{{ logical :: resetAlarms threadNum = mpas_threading_get_thread_num() - + if (present(streamID)) then STREAM_DEBUG_WRITE('-- Called MPAS_stream_mgr_reset_alarms() for stream ' // trim(streamID)) else @@ -1496,7 +1496,7 @@ subroutine MPAS_stream_mgr_reset_alarms(manager, streamID, direction, ierr)!{{{ alarm_cursor => stream % alarmList_in % head do while (associated(alarm_cursor)) if (mpas_is_alarm_ringing(manager % streamClock, alarm_cursor % name, ierr=local_ierr)) then - call mpas_reset_clock_alarm(manager % streamClock, alarm_cursor % name, ierr=local_ierr) + call mpas_reset_clock_alarm(manager % streamClock, alarm_cursor % name, ierr=local_ierr) end if alarm_cursor => alarm_cursor % next end do @@ -1506,7 +1506,7 @@ subroutine MPAS_stream_mgr_reset_alarms(manager, streamID, direction, ierr)!{{{ alarm_cursor => stream % alarmList_out % head do while (associated(alarm_cursor)) if (mpas_is_alarm_ringing(manager % streamClock, alarm_cursor % name, ierr=local_ierr)) then - call mpas_reset_clock_alarm(manager % streamClock, alarm_cursor % name, ierr=local_ierr) + call mpas_reset_clock_alarm(manager % streamClock, alarm_cursor % name, ierr=local_ierr) end if alarm_cursor => alarm_cursor % next end do @@ -1524,7 +1524,7 @@ subroutine MPAS_stream_mgr_reset_alarms(manager, streamID, direction, ierr)!{{{ alarm_cursor => manager % alarms_in % head do while (associated(alarm_cursor)) if (mpas_is_alarm_ringing(manager % streamClock, alarm_cursor % name, ierr=local_ierr)) then - call mpas_reset_clock_alarm(manager % streamClock, alarm_cursor % name, ierr=local_ierr) + call mpas_reset_clock_alarm(manager % streamClock, alarm_cursor % name, ierr=local_ierr) end if alarm_cursor => alarm_cursor % next end do @@ -1535,7 +1535,7 @@ subroutine MPAS_stream_mgr_reset_alarms(manager, streamID, direction, ierr)!{{{ alarm_cursor => manager % alarms_out % head do while (associated(alarm_cursor)) if (mpas_is_alarm_ringing(manager % streamClock, alarm_cursor % name, ierr=local_ierr)) then - call mpas_reset_clock_alarm(manager % streamClock, alarm_cursor % name, ierr=local_ierr) + call mpas_reset_clock_alarm(manager % streamClock, alarm_cursor % name, ierr=local_ierr) end if alarm_cursor => alarm_cursor % next end do @@ -1553,10 +1553,10 @@ end subroutine MPAS_stream_mgr_reset_alarms!}}} !> \author Michael Duda !> \date 30 September 2014 !> \details - !> Tests whether any I/O alarms in a stream manager are ringing; if the optional - !> 'streamID' argument is given, only alarms for that stream are tested; if - !> the optional argument 'direction' is given, only alarms for the specified - !> direction are tested. If any of the tested alarms is ringing, the function + !> Tests whether any I/O alarms in a stream manager are ringing; if the optional + !> 'streamID' argument is given, only alarms for that stream are tested; if + !> the optional argument 'direction' is given, only alarms for the specified + !> direction are tested. If any of the tested alarms is ringing, the function !> returns .true.; otherwise, it returns .false.. !> Note: This function doesn't support streamID regular expressions ! @@ -1576,7 +1576,7 @@ logical function MPAS_stream_mgr_ringing_alarms(manager, streamID, direction, ie integer :: local_ierr, threadNum threadNum = mpas_threading_get_thread_num() - + STREAM_DEBUG_WRITE('-- Called MPAS_stream_mgr_ringing_alarms()') MPAS_stream_mgr_ringing_alarms = .false. @@ -1797,7 +1797,7 @@ subroutine MPAS_stream_mgr_set_property_int(manager, streamID, propertyName, pro if ( .not. setProperties ) then STREAM_ERROR_WRITE('No stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_set_property().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if @@ -1861,7 +1861,7 @@ subroutine MPAS_stream_mgr_set_property_char(manager, streamID, propertyName, pr call mpas_set_time(stream_cursor % referenceTime, dateTimeString=propertyValue) case (MPAS_STREAM_PROPERTY_RECORD_INTV) - + ! The interval between records may not have been allocated if the optional recordInterval ! argument was not provided when the stream was created if (.not. associated(stream_cursor % recordInterval)) then @@ -1882,7 +1882,7 @@ subroutine MPAS_stream_mgr_set_property_char(manager, streamID, propertyName, pr if ( .not. setProperties ) then STREAM_ERROR_WRITE('No stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_set_property().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if @@ -1955,7 +1955,7 @@ subroutine MPAS_stream_mgr_set_property_logical(manager, streamID, propertyName, if ( .not. setProperties ) then STREAM_ERROR_WRITE('No stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_set_property().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if @@ -2000,7 +2000,7 @@ subroutine MPAS_stream_mgr_get_property_int(manager, streamID, propertyName, pro if (.not. MPAS_stream_list_query(manager % streams, streamID, stream_cursor, ierr=err_local)) then STREAM_ERROR_WRITE('Stream '//trim(streamID)//' does not exist in call to MPAS_stream_mgr_get_property().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if ! @@ -2070,7 +2070,7 @@ subroutine MPAS_stream_mgr_get_property_char(manager, streamID, propertyName, pr if (.not. MPAS_stream_list_query(manager % streams, streamID, stream_cursor, ierr=err_local)) then STREAM_ERROR_WRITE('Stream '//trim(streamID)//' does not exist in call to MPAS_stream_mgr_get_property().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if ! @@ -2094,9 +2094,9 @@ subroutine MPAS_stream_mgr_get_property_char(manager, streamID, propertyName, pr ! assume that the interval is the shortest interval between alarms on the stream; since ! recordInterval is only used for reading, use the input alarm list in this check. if (.not. associated(stream_cursor % recordInterval)) then - + ! - ! If no direction is specified, return the read interval, since this was the only historic + ! If no direction is specified, return the read interval, since this was the only historic ! use of the recordInterval for a stream. ! if (present(direction)) then @@ -2177,7 +2177,7 @@ subroutine MPAS_stream_mgr_get_property_logical(manager, streamID, propertyName, if (.not. MPAS_stream_list_query(manager % streams, streamID, stream_cursor, ierr=err_local)) then STREAM_ERROR_WRITE('Stream '//trim(streamID)//' does not exist in call to MPAS_stream_mgr_get_property().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if ! @@ -2255,14 +2255,14 @@ subroutine MPAS_stream_mgr_add_pkg(manager, streamID, packageName, ierr)!{{{ ! ! Add package to the packages pool for the stream ! - call mpas_pool_add_package(stream_cursor % pkg_pool, packageName, package) + call mpas_pool_add_package(stream_cursor % pkg_pool, packageName, package) end do if ( .not. addedPackages ) then STREAM_ERROR_WRITE('No stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_add_pkg().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if @@ -2320,7 +2320,7 @@ subroutine MPAS_stream_mgr_remove_pkg(manager, streamID, packageName, ierr)!{{{ if ( .not. removedPackage ) then STREAM_ERROR_WRITE('No stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_remove_pkg().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if @@ -2384,7 +2384,7 @@ subroutine MPAS_stream_mgr_add_att_int(manager, attName, attVal, streamID, ierr) if (mpas_pool_config_type(att_pool, attName) /= MPAS_POOL_FATAL) then STREAM_ERROR_WRITE('Attribute '//trim(attName)//' in stream '//trim(stream_cursor % name)//' is not of type integer.') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if call mpas_pool_add_config(att_pool, attName, attVal) else @@ -2395,7 +2395,7 @@ subroutine MPAS_stream_mgr_add_att_int(manager, attName, attVal, streamID, ierr) if ( .not. addedAttribute ) then STREAM_ERROR_WRITE('No stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_add_att().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if else @@ -2413,7 +2413,7 @@ subroutine MPAS_stream_mgr_add_att_int(manager, attName, attVal, streamID, ierr) if (mpas_pool_config_type(att_pool, attName) /= MPAS_POOL_FATAL) then STREAM_ERROR_WRITE('Attribute '//trim(attName)//' in streamManager is not of type integer.') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if call mpas_pool_add_config(att_pool, attName, attVal) else @@ -2483,7 +2483,7 @@ subroutine MPAS_stream_mgr_add_att_real(manager, attName, attVal, streamID, ierr if (mpas_pool_config_type(att_pool, attName) /= MPAS_POOL_FATAL) then STREAM_ERROR_WRITE('Attribute '//trim(attName)//' in stream '//trim(stream_cursor % name)//' is not of type real.') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if call mpas_pool_add_config(att_pool, attName, attVal) else @@ -2494,7 +2494,7 @@ subroutine MPAS_stream_mgr_add_att_real(manager, attName, attVal, streamID, ierr if ( .not. addedAttribute ) then STREAM_ERROR_WRITE('No stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_add_att().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if else @@ -2513,7 +2513,7 @@ subroutine MPAS_stream_mgr_add_att_real(manager, attName, attVal, streamID, ierr if (mpas_pool_config_type(att_pool, attName) /= MPAS_POOL_FATAL) then STREAM_ERROR_WRITE('Attribute '//trim(attName)//' in streamManager is not of type real.') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if call mpas_pool_add_config(att_pool, attName, attVal) else @@ -2583,7 +2583,7 @@ subroutine MPAS_stream_mgr_add_att_char(manager, attName, attVal, streamID, ierr if (mpas_pool_config_type(att_pool, attName) /= MPAS_POOL_FATAL) then STREAM_ERROR_WRITE('Attribute '//trim(attName)//' in stream '//trim(stream_cursor % name)//' is not of type character.') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if call mpas_pool_add_config(att_pool, attName, attVal) else @@ -2594,7 +2594,7 @@ subroutine MPAS_stream_mgr_add_att_char(manager, attName, attVal, streamID, ierr if ( .not. addedAttribute ) then STREAM_ERROR_WRITE('No stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_add_att().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if else @@ -2613,7 +2613,7 @@ subroutine MPAS_stream_mgr_add_att_char(manager, attName, attVal, streamID, ierr if (mpas_pool_config_type(att_pool, attName) /= MPAS_POOL_FATAL) then STREAM_ERROR_WRITE('Attribute '//trim(attName)//' in streamManager is not of type character.') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if call mpas_pool_add_config(att_pool, attName, attVal) else @@ -2683,7 +2683,7 @@ subroutine MPAS_stream_mgr_add_att_logical(manager, attName, attVal, streamID, i if (mpas_pool_config_type(att_pool, attName) /= MPAS_POOL_FATAL) then STREAM_ERROR_WRITE('Attribute '//trim(attName)//' in stream '//trim(stream_cursor % name)//' is not of type logical.') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if call mpas_pool_add_config(att_pool, attName, attVal) else @@ -2694,7 +2694,7 @@ subroutine MPAS_stream_mgr_add_att_logical(manager, attName, attVal, streamID, i if ( .not. addedAttribute ) then STREAM_ERROR_WRITE('No stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_add_att().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if else @@ -2713,7 +2713,7 @@ subroutine MPAS_stream_mgr_add_att_logical(manager, attName, attVal, streamID, i if (mpas_pool_config_type(att_pool, attName) /= MPAS_POOL_FATAL) then STREAM_ERROR_WRITE('Attribute '//trim(attName)//' in streamManger is not of type logical.') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if call mpas_pool_add_config(att_pool, attName, attVal) else @@ -2737,11 +2737,11 @@ end subroutine MPAS_stream_mgr_add_att_logical!}}} !> stream is only written if any of its alarms are ringing. !> The "timeLevel" argument optionally specifies, for fields with multiple !> time levels, the time level from which fields should be written. - !> The "mgLevel" argument optionally specifies, for fields that exist for + !> The "mgLevel" argument optionally specifies, for fields that exist for !> multiple grid levels, the grid level from which fields should be written. - !> The "forceWriteNow" argument optionally specifies that all streams -- or - !> the stream specified by the "streamID" argument -- should be written by - !> the call regardless of whether any alarms associated with the stream(s) + !> The "forceWriteNow" argument optionally specifies that all streams -- or + !> the stream specified by the "streamID" argument -- should be written by + !> the call regardless of whether any alarms associated with the stream(s) !> are ringing. The "writeTime" argument optionally specifies a time stamp !> to be used for expanding a filename template, when it is not passed in, !> the current time of the streamManager's clock is used to expand filename @@ -2833,7 +2833,7 @@ subroutine MPAS_stream_mgr_write(manager, streamID, timeLevel, mgLevel, forceWri if ( .not. wroteStreams ) then STREAM_ERROR_WRITE('No output stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_write().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if else nullify(stream_cursor) @@ -2880,11 +2880,11 @@ end subroutine MPAS_stream_mgr_write !}}} !> stream is only written if any of its alarms are ringing. !> The "timeLevel" argument optionally specifies, for fields with multiple !> time levels, the time level from which fields should be written. - !> The "mgLevel" argument optionally specifies, for fields that exist for + !> The "mgLevel" argument optionally specifies, for fields that exist for !> multiple grid levels, the grid level from which fields should be written. - !> The "forceWriteNow" argument optionally specifies that all streams -- or - !> the stream specified by the "streamID" argument -- should be written by - !> the call regardless of whether any alarms associated with the stream(s) + !> The "forceWriteNow" argument optionally specifies that all streams -- or + !> the stream specified by the "streamID" argument -- should be written by + !> the call regardless of whether any alarms associated with the stream(s) !> are ringing. The "writeTime" argument optionally specifies a time stamp !> to be used for expanding a filename template, when it is not passed in, !> the current time of the streamManager's clock is used to expand filename @@ -3013,7 +3013,7 @@ subroutine MPAS_stream_mgr_block_write(manager, writeBlock, streamID, timeLevel, if ( .not. wroteStreams ) then STREAM_ERROR_WRITE('No output stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_block_write().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if else nullify(stream_cursor) @@ -3054,7 +3054,7 @@ subroutine MPAS_stream_mgr_block_write(manager, writeBlock, streamID, timeLevel, call mpas_dmpar_finalize(debugContext % dminfo) deallocate(debugContext % dminfo) - deallocate(debugContext) + deallocate(debugContext) end if call mpas_threading_barrier() @@ -3183,7 +3183,7 @@ subroutine write_stream(manager, stream, blockID, timeLevel, mgLevel, forceWrite ! Based on clobber_mode, determine if it matters if the file exists or not. if ( stream % clobber_mode == MPAS_STREAM_CLOBBER_OVERWRITE .or. stream % clobber_mode == MPAS_STREAM_CLOBBER_APPEND ) then STREAM_DEBUG_WRITE(' -- Cobber mode is overwrite or append...') - + ! Check if the file exists if (manager % ioContext % dminfo % my_proc_id == IO_NODE) then inquire(file=trim(stream % filename), exist=recordSeek) @@ -3220,12 +3220,12 @@ subroutine write_stream(manager, stream, blockID, timeLevel, mgLevel, forceWrite if ( recordSeek ) then STREAM_DEBUG_WRITE(' -- File exists on disk: ' // trim(stream % filename)) call mpas_get_time(writeTime, dateTimeString=now_string) - + ! Look for exact record (in the case of overwriting) ! This also gets the number of records in the file. stream % nRecords = MPAS_seekStream(stream % stream, now_string, MPAS_STREAM_EXACT_TIME, actualWhen, maxRecords, local_ierr) STREAM_DEBUG_WRITE(' -- Seeked record is: $i with current records equal to $i and an error of $i' COMMA intArgs=(/stream % nRecords COMMA maxRecords COMMA local_ierr/)) - + if ( stream % nRecords == 0 ) then ! If we didn't find an exact time, set record to point to the end of the file. ! This might result in non-monotonic timestamps in the output file. @@ -3269,7 +3269,7 @@ subroutine write_stream(manager, stream, blockID, timeLevel, mgLevel, forceWrite ! Based on clobber_mode, determine if it matters if the file exists or not. if ( stream % clobber_mode == MPAS_STREAM_CLOBBER_OVERWRITE .or. stream % clobber_mode == MPAS_STREAM_CLOBBER_APPEND ) then STREAM_DEBUG_WRITE(' -- Cobber mode is overwrite or append...') - + ! Check if the file exists if (manager % ioContext % dminfo % my_proc_id == IO_NODE) then inquire(file=trim(stream % filename), exist=recordSeek) @@ -3308,12 +3308,12 @@ subroutine write_stream(manager, stream, blockID, timeLevel, mgLevel, forceWrite if ( recordSeek ) then STREAM_DEBUG_WRITE(' -- File exists on disk: ' // trim(stream % filename)) call mpas_get_time(writeTime, dateTimeString=now_string) - + ! Look for exact record (in the case of overwriting) ! This also gets the number of records in the file. stream % nRecords = MPAS_seekStream(stream % stream, now_string, MPAS_STREAM_EXACT_TIME, actualWhen, maxRecords, local_ierr) STREAM_DEBUG_WRITE(' -- Seeked record is: $i with current records equal to $i and an error of $i' COMMA intArgs=(/stream % nRecords COMMA maxRecords COMMA local_ierr/)) - + if ( stream % nRecords == 0 ) then ! If we didn't find an exact time, set record to point to the end of the file. ! This might result in non-monotonic timestamps in the output file. @@ -3333,12 +3333,12 @@ subroutine write_stream(manager, stream, blockID, timeLevel, mgLevel, forceWrite stream % nRecords = stream % nRecords + 1 if ( stream % clobber_mode == MPAS_STREAM_CLOBBER_OVERWRITE .or. stream % clobber_mode == MPAS_STREAM_CLOBBER_APPEND ) then call mpas_get_time(writeTime, dateTimeString=now_string) - + ! Look for exact record (in the case of overwriting) ! This also gets the number of records in the file. tempRecord = MPAS_seekStream(stream % stream, now_string, MPAS_STREAM_EXACT_TIME, actualWhen, maxRecords, local_ierr) STREAM_DEBUG_WRITE(' -- Seeked record is: $i with current records equal to $i and an error of $i' COMMA intArgs=(/tempRecord COMMA maxRecords COMMA local_ierr/)) - + if ( tempRecord /= 0 .and. stream % nRecords < maxRecords ) then ! If we found an exact result ! This might result in non-monotonic timestamps in the output file. @@ -3378,9 +3378,9 @@ subroutine write_stream(manager, stream, blockID, timeLevel, mgLevel, forceWrite call prewrite_reindex(manager % allFields, manager % allPackages, stream % field_pool, stream % field_pkg_pool) end if - ! + ! ! Write the stream - ! + ! STREAM_DEBUG_WRITE(' -- Writing stream ' // trim(stream % name)) call MPAS_writeStream(stream % stream, stream % nRecords, ierr=local_ierr) @@ -3435,19 +3435,19 @@ end subroutine write_stream !}}} !> is only read if any of its alarms are ringing. !> The "timeLevel" argument optionally specifies, for fields with multiple !> time levels, the time level into which fields should be read. - !> The "mgLevel" argument optionally specifies, for fields that exist for + !> The "mgLevel" argument optionally specifies, for fields that exist for !> multiple grid levels, the grid level into which fields should be read. !> The "when" argument optionally specifies the timestamp from which fields !> are to be read. !> The "whence" argument optionally specifies the method for determining !> the timestamp to read from in case an exact match is not found for the !> read timestamp, which is the current time unless the optional "when" - !> argument is given; possible values are MPAS_STREAM_EXACT_TIME, - !> MPAS_STREAM_NEAREST, MPAS_STREAM_LATEST_BEFORE, - !> MPAS_STREAM_LATEST_STRICTLY_BEFORE, MPAS_STREAM_EARLIEST_AFTER, or + !> argument is given; possible values are MPAS_STREAM_EXACT_TIME, + !> MPAS_STREAM_NEAREST, MPAS_STREAM_LATEST_BEFORE, + !> MPAS_STREAM_LATEST_STRICTLY_BEFORE, MPAS_STREAM_EARLIEST_AFTER, or !> MPAS_STREAM_EARLIEST_STRICTLY_AFTER. - !> The optional output argument "actualWhen" returns the actual time read - !> from a stream in case an exact match for the "when" time is not found, + !> The optional output argument "actualWhen" returns the actual time read + !> from a stream in case an exact match for the "when" time is not found, !> and a nearby time is selected using the "whence" argument. ! !----------------------------------------------------------------------- @@ -3473,7 +3473,7 @@ subroutine MPAS_stream_mgr_read(manager, streamID, timeLevel, mgLevel, rightNow, integer :: local_whence integer :: local_ierr integer :: temp_ierr - type (MPAS_Time_type) :: now_time + type (MPAS_Time_type) :: now_time integer :: threadNum logical :: readStreams @@ -3529,7 +3529,7 @@ subroutine MPAS_stream_mgr_read(manager, streamID, timeLevel, mgLevel, rightNow, nullify(stream_cursor) do while (MPAS_stream_list_query(manager % streams, streamID, stream_cursor, ierr=ierr)) STREAM_DEBUG_WRITE('-- Handling read of stream '//trim(stream_cursor % name)) - + ! Verify that the stream is an input stream if (stream_cursor % direction == MPAS_STREAM_INPUT .or. stream_cursor % direction == MPAS_STREAM_INPUT_OUTPUT) then readStreams = .true. @@ -3541,18 +3541,18 @@ subroutine MPAS_stream_mgr_read(manager, streamID, timeLevel, mgLevel, rightNow, if ( .not. readStreams ) then STREAM_ERROR_WRITE('No input stream matching '//trim(streamID)//' exists in call to MPAS_stream_mgr_read().') if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR - return + return end if else nullify(stream_cursor) stream_cursor => manager % streams % head do while (associated(stream_cursor)) STREAM_DEBUG_WRITE('-- Handling read of stream '//trim(stream_cursor % name)) - + ! Verify that the stream is an input stream if (stream_cursor % direction == MPAS_STREAM_INPUT .or. & stream_cursor % direction == MPAS_STREAM_INPUT_OUTPUT) then - + ! ! What should be the meaning of actualWhen if we read multiple streams in this call? ! @@ -3562,7 +3562,7 @@ subroutine MPAS_stream_mgr_read(manager, streamID, timeLevel, mgLevel, rightNow, local_ierr = MPAS_STREAM_MGR_ERROR end if end if - + stream_cursor => stream_cursor % next end do end if @@ -3677,9 +3677,8 @@ subroutine read_stream(manager, stream, timeLevel, mgLevel, forceReadNow, when, ! if ( stream % filename_interval /= 'none' ) then call mpas_set_time(now_time, dateTimeString=when, ierr=local_ierr) - call mpas_set_timeInterval(filename_interval, timeString=stream % filename_interval) - + call mpas_build_stream_filename(stream % referenceTime, now_time, filename_interval, stream % filename_template, blockID_local, temp_filename, ierr=local_ierr) else call mpas_expand_string(when, blockID_local, stream % filename_template, temp_filename) @@ -3848,7 +3847,7 @@ subroutine read_stream(manager, stream, timeLevel, mgLevel, forceReadNow, when, call mpas_get_time(filenameTime, dateTimeString=test_when) call mpas_set_timeInterval(filename_interval, timeString=stream % filename_interval) - + call mpas_build_stream_filename(stream % referenceTime, filenameTime, filename_interval, stream % filename_template, blockID_local, test_filename, ierr=local_ierr) STREAM_DEBUG_WRITE(' --- Retesting filename is ' // trim(test_filename)) @@ -3963,9 +3962,9 @@ subroutine read_stream(manager, stream, timeLevel, mgLevel, forceReadNow, when, stream % timeLevel = timeLevel end if - ! + ! ! Read the stream - ! + ! call MPAS_readStream(stream % stream, stream % nRecords, ierr=local_ierr) if (local_ierr /= MPAS_STREAM_NOERR) then ierr = MPAS_STREAM_MGR_ERROR @@ -4001,13 +4000,13 @@ end subroutine read_stream !}}} !----------------------------------------------------------------------- ! routine MPAS_stream_mesg ! - !> \brief Write an error message (if the level requires it) to + !> \brief Write an error message (if the level requires it) to !> \author Michael Duda, Doug Jacobsen !> \date 07/16/2014 - !> \details Using the input error level, + !> \details Using the input error level, !----------------------------------------------------------------------- subroutine MPAS_stream_mesg(level, mesg)!{{{ - + use mpas_dmpar implicit none @@ -4104,7 +4103,7 @@ end subroutine mpas_get_stream_filename !}}} !> \brief Construct the filename that contains a specific time in a stream !> \author Michael Duda, Doug Jacobsen !> \date 21 August 2014 - !> \details + !> \details !> Given a filename template and the information necessary to determine the time !> in the stream that matches a time available in any of the files associated with !> the stream, returns a specific filename that should contain that time. @@ -4115,7 +4114,7 @@ end subroutine mpas_get_stream_filename !}}} !> !> This is a low level subroutine to complement the !> mpas_get_stream_Filename routine - !> + !> !> Return error codes: !> 0 no error !----------------------------------------------------------------------- @@ -4162,7 +4161,7 @@ subroutine mpas_build_stream_filename(ref_time, when, filename_interval, filenam call mpas_get_timeInterval(intv, timeString=temp_string) STREAM_DEBUG_WRITE(' ** intv is: ' // trim(temp_string)) - call mpas_interval_division(ref_time, intv, filename_interval, nrecs, rem) + call mpas_interval_division(ref_time, intv, filename_interval, nrecs, rem) ! STREAM_DEBUG_WRITE(' ** Divisions are: $i' COMMA intArgs=(/nrecs/)) @@ -4193,7 +4192,7 @@ end subroutine mpas_build_stream_filename !}}} !> \brief This is a utility routine to build a stream type from a pool representing a stream. !> \author Michael Duda, Doug Jacobsen !> \date 07/23/2014 - !> \details + !> \details !> This routine will take as input a pool representing a stream. !> It will then generate a stream type based on this pool, and return that. !----------------------------------------------------------------------- @@ -4412,8 +4411,8 @@ end subroutine build_stream !}}} !> \brief Updates the time level for fields in a stream !> \author Michael Duda, Doug Jacobsen !> \date 07/23/2014 - !> \details - !> For an existing stream, updates the time levels for all fields in + !> \details + !> For an existing stream, updates the time levels for all fields in !> the stream so that subsequent reads/writes of the stream will read !> from / write to the specified time level. !----------------------------------------------------------------------- @@ -4528,7 +4527,7 @@ end subroutine update_stream !}}} !> \brief Checks whether a stream has any active packages (or none at all) !> \author Michael Duda !> \date 23 September 2014 - !> \details + !> \details !> This function determines whether a stream has any active packages !> associated with it. If the stream has at least one active package, !> or no packages at all, the function returns true; else, if all packages @@ -4577,32 +4576,32 @@ end function stream_active_pkg_check !}}} !> \brief Parses a semi-colon-separated list of package names, indicating whether any are active !> \author Michael Duda !> \date 19 March 2015 - !> \details - !> This function determines whether any of the named strings in + !> \details + !> This function determines whether any of the named strings in !> the semi-colon-separated list provided in the 'packages' argument are - !> active. + !> active. !> If any of the packages does not exist in the package pool, the optional - !> argument ierr is set to a non-zero value; otherwise, if all packages exist, + !> argument ierr is set to a non-zero value; otherwise, if all packages exist, !> ierr will be set to zero upon return. ! !----------------------------------------------------------------------- logical function parse_package_list(package_pool, packages, ierr) result(active) - + implicit none - + type (mpas_pool_type), intent(in) :: package_pool character (len=*), intent(in) :: packages integer, intent(out), optional :: ierr - + integer :: i, j, slen integer :: err_level logical, pointer :: pkg_val - - + + if (present(ierr)) ierr = 0 - + slen = len_trim(packages) - + ! ! No packages @@ -4611,7 +4610,7 @@ logical function parse_package_list(package_pool, packages, ierr) result(active) active = .true. return end if - + active = .false. err_level = mpas_pool_get_error_level() @@ -4843,8 +4842,8 @@ end subroutine exch_all_halos !}}} !> \brief Determines whether a dimension represents a decomposed dimension or not !> \author Michael Duda !> \date 24 September 2014 - !> \details - !> This function determines whether the name of the input argument is + !> \details + !> This function determines whether the name of the input argument is !> a decompsed dimension or not. Currently in MPAS, the only decomposed !> dimensions are: !> nCells @@ -4879,8 +4878,8 @@ end function is_decomposed_dim !}}} !> \brief Reindex connectivity fields from local to global index space. !> \author Doug Jacobsen, Michael Duda !> \date 24 September 2014 - !> \details - !> For any connectivity fields contained in the stream to be written, + !> \details + !> For any connectivity fields contained in the stream to be written, !> whose fields include those in the streamFields pool, save the locally !> indexed fields in module variables *_save, and allocate new arrays for !> the fields, which are set to contain global indices. @@ -5216,12 +5215,12 @@ end subroutine prewrite_reindex !}}} !> \brief Reindex connectivity fields from global to local index space. !> \author Doug Jacobsen, Michael Duda !> \date 24 September 2014 - !> \details - !> For any connectivity fields contained in the stream to be written, + !> \details + !> For any connectivity fields contained in the stream to be written, !> whose fields include those in the streamFields pool, restore the locally !> indexed fields from module variables *_save. !> This routine should be called immediately after a write of a stream. - !> + !> !> NB: Even if the write of a stream fails, it is important to stil call !> this routine to reset the connectivity fields to contain local indices. !> @@ -5264,35 +5263,35 @@ subroutine postwrite_reindex(allFields, streamFields) !{{{ if (associated(cellsOnCell_save)) then cellsOnCell_ptr => cellsOnCell_save call mpas_pool_get_field(allFields, 'cellsOnCell', cellsOnCell) - end if + end if if (associated(edgesOnCell_save)) then edgesOnCell_ptr => edgesOnCell_save call mpas_pool_get_field(allFields, 'edgesOnCell', edgesOnCell) - end if + end if if (associated(verticesOnCell_save)) then verticesOnCell_ptr => verticesOnCell_save call mpas_pool_get_field(allFields, 'verticesOnCell', verticesOnCell) - end if + end if if (associated(cellsOnEdge_save)) then cellsOnEdge_ptr => cellsOnEdge_save call mpas_pool_get_field(allFields, 'cellsOnEdge', cellsOnEdge) - end if + end if if (associated(verticesOnEdge_save)) then verticesOnEdge_ptr => verticesOnEdge_save call mpas_pool_get_field(allFields, 'verticesOnEdge', verticesOnEdge) - end if + end if if (associated(edgesOnEdge_save)) then edgesOnEdge_ptr => edgesOnEdge_save call mpas_pool_get_field(allFields, 'edgesOnEdge', edgesOnEdge) - end if + end if if (associated(cellsOnVertex_save)) then cellsOnVertex_ptr => cellsOnVertex_save call mpas_pool_get_field(allFields, 'cellsOnVertex', cellsOnVertex) - end if + end if if (associated(edgesOnVertex_save)) then edgesOnVertex_ptr => edgesOnVertex_save call mpas_pool_get_field(allFields, 'edgesOnVertex', edgesOnVertex) - end if + end if ! ! Reset indices for connectivity arrays from global to local index space @@ -5403,8 +5402,8 @@ end subroutine postwrite_reindex !}}} !> \brief Reindex connectivity fields from global to local index space. !> \author Doug Jacobsen, Michael Duda !> \date 24 September 2014 - !> \details - !> For any connectivity fields contained in the stream that was read, + !> \details + !> For any connectivity fields contained in the stream that was read, !> whose fields include those in the streamFields pool, convert the !> globally indexed connectivity fields in the stream to local index space. !> This routine should be called immediately after a read of a stream. @@ -5657,13 +5656,13 @@ end subroutine postread_reindex !}}} !> \author Doug Jacobsen, Michael Duda !> \date 03/03/2015 !> \details - !> If the optional 'streamID' argument is provided, this routine resets - !> the iterator within a stream manager so that streams may subsequently - !> be iterated over using the MPAS_stream_mgr_get_next_stream function. + !> If the optional 'streamID' argument is provided, this routine resets + !> the iterator within a stream manager so that streams may subsequently + !> be iterated over using the MPAS_stream_mgr_get_next_stream function. !> !> If an optional stream name is provided via the 'streamID' argument, this - !> routine will reset the iterator for fields within the specified stream, - !> which may subsequently iterated over using the + !> routine will reset the iterator for fields within the specified stream, + !> which may subsequently iterated over using the !> MPAS_stream_mgr_get_next_field() routine. !> !> NOTE: This routine does not support regular expressions for StreamID @@ -5828,7 +5827,7 @@ end function MPAS_stream_mgr_get_next_stream !}}} !> the stream manager. !> !> This function returns .TRUE. if the stream contains another field, - !> whether active or not, in which case the output argument fieldName + !> whether active or not, in which case the output argument fieldName !> provides the name of this field, and .FALSE. otherwise. If a field name !> is returned, the optional logical argument isActive may be used to !> determine whether the field is currently active in the stream. @@ -5884,7 +5883,7 @@ logical function MPAS_stream_mgr_get_next_field(manager, streamID, fieldName, is else isActive = .true. end if - + call mpas_pool_set_error_level(err_level) end if @@ -5920,7 +5919,7 @@ logical function MPAS_stream_mgr_stream_exists(manager, streamID) result(validSt return end function MPAS_stream_mgr_stream_exists!}}} - + end module mpas_stream_manager @@ -6020,7 +6019,7 @@ subroutine stream_mgr_create_stream_c(manager_c, streamID_c, direction_c, filena end if STREAM_DEBUG_WRITE('Creating stream from c...') - + ! ! For immutable streams, the stream should have already been defined at this point, and ! all we need to do is update the stream's filename template; diff --git a/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/namelist.atmosphere.gsl b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/namelist.atmosphere.gsl new file mode 100644 index 0000000000..2670eb3afb --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/namelist.atmosphere.gsl @@ -0,0 +1,73 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true + config_lbc_w = "zero" +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'convection_permitting' + config_mynn_closure = 2.5 + config_mynn_mixlength = 2 + config_mynn_edmf_mom = 0 + config_mynn_mixscalars = 1 + config_microp_re = false +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/namelist.atmosphere.ncar b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/namelist.atmosphere.ncar new file mode 100644 index 0000000000..70f9830937 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/namelist.atmosphere.ncar @@ -0,0 +1,72 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'convection_permitting' + config_mynn_closure = 2.5 + config_mynn_mixlength = 2 + config_mynn_edmf_mom = 0 + config_mynn_mixscalars = 1 + config_microp_re = false +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/stream_list.atmosphere.diagnostics b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/stream_list.atmosphere.diagnostics new file mode 100644 index 0000000000..4e7979fb61 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/stream_list.atmosphere.diagnostics @@ -0,0 +1,92 @@ +initial_time +xtime +olrtoa +rainc +rainnc +refl10cm_max +refl10cm_1km +refl10cm_1km_max +precipw +u10 +v10 +q2 +t2m +th2m +mslp +relhum_200hPa +relhum_250hPa +relhum_500hPa +relhum_700hPa +relhum_850hPa +relhum_925hPa +dewpoint_200hPa +dewpoint_250hPa +dewpoint_500hPa +dewpoint_700hPa +dewpoint_850hPa +dewpoint_925hPa +temperature_200hPa +temperature_250hPa +temperature_500hPa +temperature_700hPa +temperature_850hPa +temperature_925hPa +height_200hPa +height_250hPa +height_500hPa +height_700hPa +height_850hPa +height_925hPa +uzonal_200hPa +uzonal_250hPa +uzonal_500hPa +uzonal_700hPa +uzonal_850hPa +uzonal_925hPa +umeridional_200hPa +umeridional_250hPa +umeridional_500hPa +umeridional_700hPa +umeridional_850hPa +umeridional_925hPa +w_200hPa +w_250hPa +w_500hPa +w_700hPa +w_850hPa +w_925hPa +vorticity_200hPa +vorticity_250hPa +vorticity_500hPa +vorticity_700hPa +vorticity_850hPa +vorticity_925hPa +t_isobaric +t_iso_levels +z_isobaric +z_iso_levels +meanT_500_300 +cape +cin +lcl +lfc +srh_0_1km +srh_0_3km +uzonal_surface +uzonal_1km +uzonal_6km +umeridional_surface +umeridional_1km +umeridional_6km +temperature_surface +dewpoint_surface +updraft_helicity_max +w_velocity_max +wind_speed_level1_max +t_oml +t_oml_initial +t_oml_200m_initial +h_oml +h_oml_initial +hu_oml +hv_oml diff --git a/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/stream_list.atmosphere.output b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/stream_list.atmosphere.output new file mode 100644 index 0000000000..24c30f010b --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/stream_list.atmosphere.output @@ -0,0 +1,110 @@ +scalars +latCell +lonCell +xCell +yCell +zCell +indexToCellID +latEdge +lonEdge +xEdge +yEdge +zEdge +indexToEdgeID +latVertex +lonVertex +xVertex +yVertex +zVertex +indexToVertexID +cellsOnEdge +nEdgesOnCell +nEdgesOnEdge +edgesOnCell +edgesOnEdge +weightsOnEdge +dvEdge +dcEdge +angleEdge +areaCell +areaTriangle +cellsOnCell +verticesOnCell +verticesOnEdge +edgesOnVertex +cellsOnVertex +kiteAreasOnVertex +meshDensity +zgrid +fzm +fzp +zz +initial_time +xtime +u +w +pressure +surface_pressure +rho +theta +relhum +divergence +vorticity +ke +uReconstructZonal +uReconstructMeridional +ertel_pv +u_pv +v_pv +theta_pv +vort_pv +depv_dt_lw +depv_dt_sw +depv_dt_bl +depv_dt_cu +depv_dt_mix +dtheta_dt_mp +depv_dt_mp +depv_dt_diab +depv_dt_fric +depv_dt_diab_pv +depv_dt_fric_pv +iLev_DT +i_rainnc +rainnc +precipw +cuprec +i_rainc +rainc +kpbl +hpbl +hfx +qfx +cd +cda +ck +cka +lh +u10 +v10 +q2 +t2m +th2m +gsw +glw +acsnow +pin +ozmixm +mminlu +isice_lu +iswater_lu +xland +skintemp +snow +snowh +sst +vegfra +xice +sh2o +smois +tslb diff --git a/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/stream_list.atmosphere.surface b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/stream_list.atmosphere.surface new file mode 100644 index 0000000000..db54cab459 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/stream_list.atmosphere.surface @@ -0,0 +1,2 @@ +sst +xice diff --git a/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/streams.atmosphere b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/streams.atmosphere new file mode 100644 index 0000000000..c4a888ac66 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.convection_permitting.gfs.winter/streams.atmosphere @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/namelist.atmosphere.gsl b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/namelist.atmosphere.gsl new file mode 100644 index 0000000000..e7cc47d8f1 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/namelist.atmosphere.gsl @@ -0,0 +1,69 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true + config_lbc_w = "zero" +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'mesoscale_reference' + config_microp_re = false +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/namelist.atmosphere.ncar b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/namelist.atmosphere.ncar new file mode 100644 index 0000000000..6229bc51dd --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/namelist.atmosphere.ncar @@ -0,0 +1,68 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'mesoscale_reference' + config_microp_re = false +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/stream_list.atmosphere.diagnostics b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/stream_list.atmosphere.diagnostics new file mode 100644 index 0000000000..4e7979fb61 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/stream_list.atmosphere.diagnostics @@ -0,0 +1,92 @@ +initial_time +xtime +olrtoa +rainc +rainnc +refl10cm_max +refl10cm_1km +refl10cm_1km_max +precipw +u10 +v10 +q2 +t2m +th2m +mslp +relhum_200hPa +relhum_250hPa +relhum_500hPa +relhum_700hPa +relhum_850hPa +relhum_925hPa +dewpoint_200hPa +dewpoint_250hPa +dewpoint_500hPa +dewpoint_700hPa +dewpoint_850hPa +dewpoint_925hPa +temperature_200hPa +temperature_250hPa +temperature_500hPa +temperature_700hPa +temperature_850hPa +temperature_925hPa +height_200hPa +height_250hPa +height_500hPa +height_700hPa +height_850hPa +height_925hPa +uzonal_200hPa +uzonal_250hPa +uzonal_500hPa +uzonal_700hPa +uzonal_850hPa +uzonal_925hPa +umeridional_200hPa +umeridional_250hPa +umeridional_500hPa +umeridional_700hPa +umeridional_850hPa +umeridional_925hPa +w_200hPa +w_250hPa +w_500hPa +w_700hPa +w_850hPa +w_925hPa +vorticity_200hPa +vorticity_250hPa +vorticity_500hPa +vorticity_700hPa +vorticity_850hPa +vorticity_925hPa +t_isobaric +t_iso_levels +z_isobaric +z_iso_levels +meanT_500_300 +cape +cin +lcl +lfc +srh_0_1km +srh_0_3km +uzonal_surface +uzonal_1km +uzonal_6km +umeridional_surface +umeridional_1km +umeridional_6km +temperature_surface +dewpoint_surface +updraft_helicity_max +w_velocity_max +wind_speed_level1_max +t_oml +t_oml_initial +t_oml_200m_initial +h_oml +h_oml_initial +hu_oml +hv_oml diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/stream_list.atmosphere.output b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/stream_list.atmosphere.output new file mode 100644 index 0000000000..24c30f010b --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/stream_list.atmosphere.output @@ -0,0 +1,110 @@ +scalars +latCell +lonCell +xCell +yCell +zCell +indexToCellID +latEdge +lonEdge +xEdge +yEdge +zEdge +indexToEdgeID +latVertex +lonVertex +xVertex +yVertex +zVertex +indexToVertexID +cellsOnEdge +nEdgesOnCell +nEdgesOnEdge +edgesOnCell +edgesOnEdge +weightsOnEdge +dvEdge +dcEdge +angleEdge +areaCell +areaTriangle +cellsOnCell +verticesOnCell +verticesOnEdge +edgesOnVertex +cellsOnVertex +kiteAreasOnVertex +meshDensity +zgrid +fzm +fzp +zz +initial_time +xtime +u +w +pressure +surface_pressure +rho +theta +relhum +divergence +vorticity +ke +uReconstructZonal +uReconstructMeridional +ertel_pv +u_pv +v_pv +theta_pv +vort_pv +depv_dt_lw +depv_dt_sw +depv_dt_bl +depv_dt_cu +depv_dt_mix +dtheta_dt_mp +depv_dt_mp +depv_dt_diab +depv_dt_fric +depv_dt_diab_pv +depv_dt_fric_pv +iLev_DT +i_rainnc +rainnc +precipw +cuprec +i_rainc +rainc +kpbl +hpbl +hfx +qfx +cd +cda +ck +cka +lh +u10 +v10 +q2 +t2m +th2m +gsw +glw +acsnow +pin +ozmixm +mminlu +isice_lu +iswater_lu +xland +skintemp +snow +snowh +sst +vegfra +xice +sh2o +smois +tslb diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/stream_list.atmosphere.surface b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/stream_list.atmosphere.surface new file mode 100644 index 0000000000..db54cab459 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/stream_list.atmosphere.surface @@ -0,0 +1,2 @@ +sst +xice diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/streams.atmosphere b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/streams.atmosphere new file mode 100644 index 0000000000..c4a888ac66 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference.gfs.winter/streams.atmosphere @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.gsl b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.gsl new file mode 100644 index 0000000000..93702c56f7 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.gsl @@ -0,0 +1,70 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true + config_lbc_w = "zero" +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'mesoscale_reference' + config_microp_re = false + config_lsm_scheme = "sf_noahmp" +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.ncar b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.ncar new file mode 100644 index 0000000000..cab4d85552 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.ncar @@ -0,0 +1,69 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'mesoscale_reference' + config_microp_re = false + config_lsm_scheme = "sf_noahmp" +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.diagnostics b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.diagnostics new file mode 100644 index 0000000000..4e7979fb61 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.diagnostics @@ -0,0 +1,92 @@ +initial_time +xtime +olrtoa +rainc +rainnc +refl10cm_max +refl10cm_1km +refl10cm_1km_max +precipw +u10 +v10 +q2 +t2m +th2m +mslp +relhum_200hPa +relhum_250hPa +relhum_500hPa +relhum_700hPa +relhum_850hPa +relhum_925hPa +dewpoint_200hPa +dewpoint_250hPa +dewpoint_500hPa +dewpoint_700hPa +dewpoint_850hPa +dewpoint_925hPa +temperature_200hPa +temperature_250hPa +temperature_500hPa +temperature_700hPa +temperature_850hPa +temperature_925hPa +height_200hPa +height_250hPa +height_500hPa +height_700hPa +height_850hPa +height_925hPa +uzonal_200hPa +uzonal_250hPa +uzonal_500hPa +uzonal_700hPa +uzonal_850hPa +uzonal_925hPa +umeridional_200hPa +umeridional_250hPa +umeridional_500hPa +umeridional_700hPa +umeridional_850hPa +umeridional_925hPa +w_200hPa +w_250hPa +w_500hPa +w_700hPa +w_850hPa +w_925hPa +vorticity_200hPa +vorticity_250hPa +vorticity_500hPa +vorticity_700hPa +vorticity_850hPa +vorticity_925hPa +t_isobaric +t_iso_levels +z_isobaric +z_iso_levels +meanT_500_300 +cape +cin +lcl +lfc +srh_0_1km +srh_0_3km +uzonal_surface +uzonal_1km +uzonal_6km +umeridional_surface +umeridional_1km +umeridional_6km +temperature_surface +dewpoint_surface +updraft_helicity_max +w_velocity_max +wind_speed_level1_max +t_oml +t_oml_initial +t_oml_200m_initial +h_oml +h_oml_initial +hu_oml +hv_oml diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.output b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.output new file mode 100644 index 0000000000..24c30f010b --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.output @@ -0,0 +1,110 @@ +scalars +latCell +lonCell +xCell +yCell +zCell +indexToCellID +latEdge +lonEdge +xEdge +yEdge +zEdge +indexToEdgeID +latVertex +lonVertex +xVertex +yVertex +zVertex +indexToVertexID +cellsOnEdge +nEdgesOnCell +nEdgesOnEdge +edgesOnCell +edgesOnEdge +weightsOnEdge +dvEdge +dcEdge +angleEdge +areaCell +areaTriangle +cellsOnCell +verticesOnCell +verticesOnEdge +edgesOnVertex +cellsOnVertex +kiteAreasOnVertex +meshDensity +zgrid +fzm +fzp +zz +initial_time +xtime +u +w +pressure +surface_pressure +rho +theta +relhum +divergence +vorticity +ke +uReconstructZonal +uReconstructMeridional +ertel_pv +u_pv +v_pv +theta_pv +vort_pv +depv_dt_lw +depv_dt_sw +depv_dt_bl +depv_dt_cu +depv_dt_mix +dtheta_dt_mp +depv_dt_mp +depv_dt_diab +depv_dt_fric +depv_dt_diab_pv +depv_dt_fric_pv +iLev_DT +i_rainnc +rainnc +precipw +cuprec +i_rainc +rainc +kpbl +hpbl +hfx +qfx +cd +cda +ck +cka +lh +u10 +v10 +q2 +t2m +th2m +gsw +glw +acsnow +pin +ozmixm +mminlu +isice_lu +iswater_lu +xland +skintemp +snow +snowh +sst +vegfra +xice +sh2o +smois +tslb diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.surface b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.surface new file mode 100644 index 0000000000..db54cab459 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.surface @@ -0,0 +1,2 @@ +sst +xice diff --git a/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/streams.atmosphere b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/streams.atmosphere new file mode 100644 index 0000000000..c4a888ac66 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/mpasdev.mesoscale_reference_noahmp.gfs.winter/streams.atmosphere @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/namelist.atmosphere.gsl b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/namelist.atmosphere.gsl new file mode 100644 index 0000000000..2670eb3afb --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/namelist.atmosphere.gsl @@ -0,0 +1,73 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true + config_lbc_w = "zero" +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'convection_permitting' + config_mynn_closure = 2.5 + config_mynn_mixlength = 2 + config_mynn_edmf_mom = 0 + config_mynn_mixscalars = 1 + config_microp_re = false +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/namelist.atmosphere.ncar b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/namelist.atmosphere.ncar new file mode 100644 index 0000000000..70f9830937 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/namelist.atmosphere.ncar @@ -0,0 +1,72 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'convection_permitting' + config_mynn_closure = 2.5 + config_mynn_mixlength = 2 + config_mynn_edmf_mom = 0 + config_mynn_mixscalars = 1 + config_microp_re = false +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/stream_list.atmosphere.diagnostics b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/stream_list.atmosphere.diagnostics new file mode 100644 index 0000000000..4e7979fb61 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/stream_list.atmosphere.diagnostics @@ -0,0 +1,92 @@ +initial_time +xtime +olrtoa +rainc +rainnc +refl10cm_max +refl10cm_1km +refl10cm_1km_max +precipw +u10 +v10 +q2 +t2m +th2m +mslp +relhum_200hPa +relhum_250hPa +relhum_500hPa +relhum_700hPa +relhum_850hPa +relhum_925hPa +dewpoint_200hPa +dewpoint_250hPa +dewpoint_500hPa +dewpoint_700hPa +dewpoint_850hPa +dewpoint_925hPa +temperature_200hPa +temperature_250hPa +temperature_500hPa +temperature_700hPa +temperature_850hPa +temperature_925hPa +height_200hPa +height_250hPa +height_500hPa +height_700hPa +height_850hPa +height_925hPa +uzonal_200hPa +uzonal_250hPa +uzonal_500hPa +uzonal_700hPa +uzonal_850hPa +uzonal_925hPa +umeridional_200hPa +umeridional_250hPa +umeridional_500hPa +umeridional_700hPa +umeridional_850hPa +umeridional_925hPa +w_200hPa +w_250hPa +w_500hPa +w_700hPa +w_850hPa +w_925hPa +vorticity_200hPa +vorticity_250hPa +vorticity_500hPa +vorticity_700hPa +vorticity_850hPa +vorticity_925hPa +t_isobaric +t_iso_levels +z_isobaric +z_iso_levels +meanT_500_300 +cape +cin +lcl +lfc +srh_0_1km +srh_0_3km +uzonal_surface +uzonal_1km +uzonal_6km +umeridional_surface +umeridional_1km +umeridional_6km +temperature_surface +dewpoint_surface +updraft_helicity_max +w_velocity_max +wind_speed_level1_max +t_oml +t_oml_initial +t_oml_200m_initial +h_oml +h_oml_initial +hu_oml +hv_oml diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/stream_list.atmosphere.output b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/stream_list.atmosphere.output new file mode 100644 index 0000000000..24c30f010b --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/stream_list.atmosphere.output @@ -0,0 +1,110 @@ +scalars +latCell +lonCell +xCell +yCell +zCell +indexToCellID +latEdge +lonEdge +xEdge +yEdge +zEdge +indexToEdgeID +latVertex +lonVertex +xVertex +yVertex +zVertex +indexToVertexID +cellsOnEdge +nEdgesOnCell +nEdgesOnEdge +edgesOnCell +edgesOnEdge +weightsOnEdge +dvEdge +dcEdge +angleEdge +areaCell +areaTriangle +cellsOnCell +verticesOnCell +verticesOnEdge +edgesOnVertex +cellsOnVertex +kiteAreasOnVertex +meshDensity +zgrid +fzm +fzp +zz +initial_time +xtime +u +w +pressure +surface_pressure +rho +theta +relhum +divergence +vorticity +ke +uReconstructZonal +uReconstructMeridional +ertel_pv +u_pv +v_pv +theta_pv +vort_pv +depv_dt_lw +depv_dt_sw +depv_dt_bl +depv_dt_cu +depv_dt_mix +dtheta_dt_mp +depv_dt_mp +depv_dt_diab +depv_dt_fric +depv_dt_diab_pv +depv_dt_fric_pv +iLev_DT +i_rainnc +rainnc +precipw +cuprec +i_rainc +rainc +kpbl +hpbl +hfx +qfx +cd +cda +ck +cka +lh +u10 +v10 +q2 +t2m +th2m +gsw +glw +acsnow +pin +ozmixm +mminlu +isice_lu +iswater_lu +xland +skintemp +snow +snowh +sst +vegfra +xice +sh2o +smois +tslb diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/stream_list.atmosphere.surface b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/stream_list.atmosphere.surface new file mode 100644 index 0000000000..db54cab459 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/stream_list.atmosphere.surface @@ -0,0 +1,2 @@ +sst +xice diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/streams.atmosphere b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/streams.atmosphere new file mode 100644 index 0000000000..c4a888ac66 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.convection_permitting.gfs.winter/streams.atmosphere @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/namelist.atmosphere b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/namelist.atmosphere new file mode 100644 index 0000000000..2e54c86387 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/namelist.atmosphere @@ -0,0 +1,62 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 4 + config_dynamics_split_steps = 3 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_scalar_advection = true + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_mpas_cam_coef = 2.0 + config_rayleigh_damp_u = true + config_zd = 16000.0 + config_xnutr = 0.2 + config_number_cam_damping_levels = 8 +/ +&limited_area + config_apply_lbcs = true +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_frac_seaice = true + config_deepsoiltemp_update = false + config_radtlw_interval = '00:15:00' + config_radtsw_interval = '00:15:00' + config_bucket_update = 'none' + config_physics_suite = 'hrrrv5' + num_soil_layers = 9 +/ +&physics_mp_tempo + config_tempo_aerosolaware = .true. + config_tempo_hailaware = .true. +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/stream_list.atmosphere.diagnostics b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/stream_list.atmosphere.diagnostics new file mode 100644 index 0000000000..048ec8b9d6 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/stream_list.atmosphere.diagnostics @@ -0,0 +1,141 @@ +initial_time +xtime +Time +snowncv +rainncv +graupelncv +prec_acc_c +prec_acc_nc +snow_acc_nc +mslp +relhum_50hPa +relhum_100hPa +relhum_200hPa +relhum_250hPa +relhum_500hPa +relhum_700hPa +relhum_850hPa +relhum_925hPa +dewpoint_50hPa +dewpoint_100hPa +dewpoint_200hPa +dewpoint_250hPa +dewpoint_500hPa +dewpoint_700hPa +dewpoint_850hPa +dewpoint_925hPa +temperature_50hPa +temperature_100hPa +temperature_200hPa +temperature_250hPa +temperature_500hPa +temperature_700hPa +temperature_850hPa +temperature_925hPa +height_50hPa +height_100hPa +height_200hPa +height_250hPa +height_500hPa +height_700hPa +height_850hPa +height_925hPa +uzonal_50hPa +uzonal_100hPa +uzonal_200hPa +uzonal_250hPa +uzonal_500hPa +uzonal_700hPa +uzonal_850hPa +uzonal_925hPa +umeridional_50hPa +umeridional_100hPa +umeridional_200hPa +umeridional_250hPa +umeridional_500hPa +umeridional_700hPa +umeridional_850hPa +umeridional_925hPa +w_50hPa +w_100hPa +w_200hPa +w_250hPa +w_500hPa +w_700hPa +w_850hPa +w_925hPa +vorticity_50hPa +vorticity_100hPa +vorticity_200hPa +vorticity_250hPa +vorticity_500hPa +vorticity_700hPa +vorticity_850hPa +vorticity_925hPa +t_isobaric +t_iso_levels +z_isobaric +z_iso_levels +meanT_500_300 +olrtoa +rainc +rainnc +refl10cm +refl10cm_max +refl10cm_1km +refl10cm_1km_max +precipw +u10 +v10 +q2 +t2m +th2m +cape +cin +lcl +lfc +srh_0_1km +srh_0_3km +uzonal_surface +uzonal_1km +uzonal_6km +umeridional_surface +umeridional_1km +umeridional_6km +temperature_surface +dewpoint_surface +updraft_helicity_max +w_velocity_max +w_velocity_min +w_velocity_mean +wind_speed_level1_max +t_oml +t_oml_initial +t_oml_200m_initial +h_oml +h_oml_initial +hu_oml +hv_oml +updraft_helicity_max_01 +updraft_helicity_max_16 +updraft_helicity_max0_15 +updraft_helicity_max05_15 +updraft_helicity_max_02 +updraft_helicity_max_03 +updraft_helicity_min_01 +updraft_helicity_min_16 +updraft_helicity_min0_15 +updraft_helicity_min05_15 +updraft_helicity_min_02 +updraft_helicity_min_03 +wind02_max +wind02_integral_max +wind_speed_10m_max +wind_speed_10m_mean +u10m_mean +v10m_mean +swdnb +swupt +swddir +swddni +swddif diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/stream_list.atmosphere.output b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/stream_list.atmosphere.output new file mode 100644 index 0000000000..9c151a488d --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/stream_list.atmosphere.output @@ -0,0 +1,127 @@ +scalars +latCell +lonCell +xCell +yCell +zCell +indexToCellID +latEdge +lonEdge +xEdge +yEdge +zEdge +indexToEdgeID +latVertex +lonVertex +xVertex +yVertex +zVertex +indexToVertexID +cellsOnEdge +nEdgesOnCell +nEdgesOnEdge +edgesOnCell +edgesOnEdge +weightsOnEdge +dvEdge +dcEdge +angleEdge +areaCell +areaTriangle +cellsOnCell +verticesOnCell +verticesOnEdge +edgesOnVertex +cellsOnVertex +kiteAreasOnVertex +meshDensity +zgrid +fzm +fzp +zz +initial_time +xtime +Time +u +w +pressure +surface_pressure +rho +theta +relhum +divergence +vorticity +ke +uReconstructZonal +uReconstructMeridional +ertel_pv +u_pv +v_pv +theta_pv +vort_pv +iLev_DT +depv_dt_lw +depv_dt_sw +depv_dt_bl +depv_dt_cu +depv_dt_mix +dtheta_dt_mp +depv_dt_mp +depv_dt_diab +depv_dt_fric +depv_dt_diab_pv +depv_dt_fric_pv +i_rainnc +rainnc +precipw +cuprec +i_rainc +rainc +kpbl +hpbl +hfx +qfx +cd +cda +ck +cka +lh +u10 +v10 +q2 +t2m +th2m +gsw +glw +acsnow +pin +ozmixm +mminlu +isice_lu +iswater_lu +xland +skintemp +snow +snowh +sst +vegfra +shdmin +shdmax +canwat +xice +sh2o +smois +tslb +soilt1 +rhosnf +snowfallac +acrunoff +grdflx +ivgtyp +isltyp +lai +sfc_albedo +cldfrac_bl +snowc +snownc +graupelnc diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/stream_list.atmosphere.surface b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/stream_list.atmosphere.surface new file mode 100644 index 0000000000..db54cab459 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/stream_list.atmosphere.surface @@ -0,0 +1,2 @@ +sst +xice diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/streams.atmosphere b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/streams.atmosphere new file mode 100644 index 0000000000..b076c1bc12 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.gfs.winter/streams.atmosphere @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/namelist.atmosphere b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/namelist.atmosphere new file mode 100644 index 0000000000..4858c5213f --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/namelist.atmosphere @@ -0,0 +1,63 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2024-08-15_18:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 4 + config_dynamics_split_steps = 3 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_scalar_advection = true + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_mpas_cam_coef = 2.0 + config_rayleigh_damp_u = true + config_zd = 16000.0 + config_xnutr = 0.2 + config_number_cam_damping_levels = 8 +/ +&limited_area + config_apply_lbcs = true +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_gvf_update = false + config_sstdiurn_update = false + config_frac_seaice = true + config_deepsoiltemp_update = false + config_radtlw_interval = '00:15:00' + config_radtsw_interval = '00:15:00' + config_bucket_update = 'none' + config_physics_suite = 'hrrrv5' + num_soil_layers = 9 +/ +&physics_mp_tempo + config_tempo_aerosolaware = .true. + config_tempo_hailaware = .true. +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/stream_list.atmosphere.diagnostics b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/stream_list.atmosphere.diagnostics new file mode 100644 index 0000000000..048ec8b9d6 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/stream_list.atmosphere.diagnostics @@ -0,0 +1,141 @@ +initial_time +xtime +Time +snowncv +rainncv +graupelncv +prec_acc_c +prec_acc_nc +snow_acc_nc +mslp +relhum_50hPa +relhum_100hPa +relhum_200hPa +relhum_250hPa +relhum_500hPa +relhum_700hPa +relhum_850hPa +relhum_925hPa +dewpoint_50hPa +dewpoint_100hPa +dewpoint_200hPa +dewpoint_250hPa +dewpoint_500hPa +dewpoint_700hPa +dewpoint_850hPa +dewpoint_925hPa +temperature_50hPa +temperature_100hPa +temperature_200hPa +temperature_250hPa +temperature_500hPa +temperature_700hPa +temperature_850hPa +temperature_925hPa +height_50hPa +height_100hPa +height_200hPa +height_250hPa +height_500hPa +height_700hPa +height_850hPa +height_925hPa +uzonal_50hPa +uzonal_100hPa +uzonal_200hPa +uzonal_250hPa +uzonal_500hPa +uzonal_700hPa +uzonal_850hPa +uzonal_925hPa +umeridional_50hPa +umeridional_100hPa +umeridional_200hPa +umeridional_250hPa +umeridional_500hPa +umeridional_700hPa +umeridional_850hPa +umeridional_925hPa +w_50hPa +w_100hPa +w_200hPa +w_250hPa +w_500hPa +w_700hPa +w_850hPa +w_925hPa +vorticity_50hPa +vorticity_100hPa +vorticity_200hPa +vorticity_250hPa +vorticity_500hPa +vorticity_700hPa +vorticity_850hPa +vorticity_925hPa +t_isobaric +t_iso_levels +z_isobaric +z_iso_levels +meanT_500_300 +olrtoa +rainc +rainnc +refl10cm +refl10cm_max +refl10cm_1km +refl10cm_1km_max +precipw +u10 +v10 +q2 +t2m +th2m +cape +cin +lcl +lfc +srh_0_1km +srh_0_3km +uzonal_surface +uzonal_1km +uzonal_6km +umeridional_surface +umeridional_1km +umeridional_6km +temperature_surface +dewpoint_surface +updraft_helicity_max +w_velocity_max +w_velocity_min +w_velocity_mean +wind_speed_level1_max +t_oml +t_oml_initial +t_oml_200m_initial +h_oml +h_oml_initial +hu_oml +hv_oml +updraft_helicity_max_01 +updraft_helicity_max_16 +updraft_helicity_max0_15 +updraft_helicity_max05_15 +updraft_helicity_max_02 +updraft_helicity_max_03 +updraft_helicity_min_01 +updraft_helicity_min_16 +updraft_helicity_min0_15 +updraft_helicity_min05_15 +updraft_helicity_min_02 +updraft_helicity_min_03 +wind02_max +wind02_integral_max +wind_speed_10m_max +wind_speed_10m_mean +u10m_mean +v10m_mean +swdnb +swupt +swddir +swddni +swddif diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/stream_list.atmosphere.output b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/stream_list.atmosphere.output new file mode 100644 index 0000000000..9c151a488d --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/stream_list.atmosphere.output @@ -0,0 +1,127 @@ +scalars +latCell +lonCell +xCell +yCell +zCell +indexToCellID +latEdge +lonEdge +xEdge +yEdge +zEdge +indexToEdgeID +latVertex +lonVertex +xVertex +yVertex +zVertex +indexToVertexID +cellsOnEdge +nEdgesOnCell +nEdgesOnEdge +edgesOnCell +edgesOnEdge +weightsOnEdge +dvEdge +dcEdge +angleEdge +areaCell +areaTriangle +cellsOnCell +verticesOnCell +verticesOnEdge +edgesOnVertex +cellsOnVertex +kiteAreasOnVertex +meshDensity +zgrid +fzm +fzp +zz +initial_time +xtime +Time +u +w +pressure +surface_pressure +rho +theta +relhum +divergence +vorticity +ke +uReconstructZonal +uReconstructMeridional +ertel_pv +u_pv +v_pv +theta_pv +vort_pv +iLev_DT +depv_dt_lw +depv_dt_sw +depv_dt_bl +depv_dt_cu +depv_dt_mix +dtheta_dt_mp +depv_dt_mp +depv_dt_diab +depv_dt_fric +depv_dt_diab_pv +depv_dt_fric_pv +i_rainnc +rainnc +precipw +cuprec +i_rainc +rainc +kpbl +hpbl +hfx +qfx +cd +cda +ck +cka +lh +u10 +v10 +q2 +t2m +th2m +gsw +glw +acsnow +pin +ozmixm +mminlu +isice_lu +iswater_lu +xland +skintemp +snow +snowh +sst +vegfra +shdmin +shdmax +canwat +xice +sh2o +smois +tslb +soilt1 +rhosnf +snowfallac +acrunoff +grdflx +ivgtyp +isltyp +lai +sfc_albedo +cldfrac_bl +snowc +snownc +graupelnc diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/stream_list.atmosphere.surface b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/stream_list.atmosphere.surface new file mode 100644 index 0000000000..db54cab459 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/stream_list.atmosphere.surface @@ -0,0 +1,2 @@ +sst +xice diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/streams.atmosphere b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/streams.atmosphere new file mode 100644 index 0000000000..b076c1bc12 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.summer/streams.atmosphere @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/namelist.atmosphere b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/namelist.atmosphere new file mode 100644 index 0000000000..e41ae89258 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/namelist.atmosphere @@ -0,0 +1,63 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2024-02-02_18:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 4 + config_dynamics_split_steps = 3 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_scalar_advection = true + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_mpas_cam_coef = 2.0 + config_rayleigh_damp_u = true + config_zd = 16000.0 + config_xnutr = 0.2 + config_number_cam_damping_levels = 8 +/ +&limited_area + config_apply_lbcs = true +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_gvf_update = false + config_sstdiurn_update = false + config_frac_seaice = true + config_deepsoiltemp_update = false + config_radtlw_interval = '00:15:00' + config_radtsw_interval = '00:15:00' + config_bucket_update = 'none' + config_physics_suite = 'hrrrv5' + num_soil_layers = 9 +/ +&physics_mp_tempo + config_tempo_aerosolaware = .true. + config_tempo_hailaware = .true. +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/stream_list.atmosphere.diagnostics b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/stream_list.atmosphere.diagnostics new file mode 100644 index 0000000000..048ec8b9d6 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/stream_list.atmosphere.diagnostics @@ -0,0 +1,141 @@ +initial_time +xtime +Time +snowncv +rainncv +graupelncv +prec_acc_c +prec_acc_nc +snow_acc_nc +mslp +relhum_50hPa +relhum_100hPa +relhum_200hPa +relhum_250hPa +relhum_500hPa +relhum_700hPa +relhum_850hPa +relhum_925hPa +dewpoint_50hPa +dewpoint_100hPa +dewpoint_200hPa +dewpoint_250hPa +dewpoint_500hPa +dewpoint_700hPa +dewpoint_850hPa +dewpoint_925hPa +temperature_50hPa +temperature_100hPa +temperature_200hPa +temperature_250hPa +temperature_500hPa +temperature_700hPa +temperature_850hPa +temperature_925hPa +height_50hPa +height_100hPa +height_200hPa +height_250hPa +height_500hPa +height_700hPa +height_850hPa +height_925hPa +uzonal_50hPa +uzonal_100hPa +uzonal_200hPa +uzonal_250hPa +uzonal_500hPa +uzonal_700hPa +uzonal_850hPa +uzonal_925hPa +umeridional_50hPa +umeridional_100hPa +umeridional_200hPa +umeridional_250hPa +umeridional_500hPa +umeridional_700hPa +umeridional_850hPa +umeridional_925hPa +w_50hPa +w_100hPa +w_200hPa +w_250hPa +w_500hPa +w_700hPa +w_850hPa +w_925hPa +vorticity_50hPa +vorticity_100hPa +vorticity_200hPa +vorticity_250hPa +vorticity_500hPa +vorticity_700hPa +vorticity_850hPa +vorticity_925hPa +t_isobaric +t_iso_levels +z_isobaric +z_iso_levels +meanT_500_300 +olrtoa +rainc +rainnc +refl10cm +refl10cm_max +refl10cm_1km +refl10cm_1km_max +precipw +u10 +v10 +q2 +t2m +th2m +cape +cin +lcl +lfc +srh_0_1km +srh_0_3km +uzonal_surface +uzonal_1km +uzonal_6km +umeridional_surface +umeridional_1km +umeridional_6km +temperature_surface +dewpoint_surface +updraft_helicity_max +w_velocity_max +w_velocity_min +w_velocity_mean +wind_speed_level1_max +t_oml +t_oml_initial +t_oml_200m_initial +h_oml +h_oml_initial +hu_oml +hv_oml +updraft_helicity_max_01 +updraft_helicity_max_16 +updraft_helicity_max0_15 +updraft_helicity_max05_15 +updraft_helicity_max_02 +updraft_helicity_max_03 +updraft_helicity_min_01 +updraft_helicity_min_16 +updraft_helicity_min0_15 +updraft_helicity_min05_15 +updraft_helicity_min_02 +updraft_helicity_min_03 +wind02_max +wind02_integral_max +wind_speed_10m_max +wind_speed_10m_mean +u10m_mean +v10m_mean +swdnb +swupt +swddir +swddni +swddif diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/stream_list.atmosphere.output b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/stream_list.atmosphere.output new file mode 100644 index 0000000000..9c151a488d --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/stream_list.atmosphere.output @@ -0,0 +1,127 @@ +scalars +latCell +lonCell +xCell +yCell +zCell +indexToCellID +latEdge +lonEdge +xEdge +yEdge +zEdge +indexToEdgeID +latVertex +lonVertex +xVertex +yVertex +zVertex +indexToVertexID +cellsOnEdge +nEdgesOnCell +nEdgesOnEdge +edgesOnCell +edgesOnEdge +weightsOnEdge +dvEdge +dcEdge +angleEdge +areaCell +areaTriangle +cellsOnCell +verticesOnCell +verticesOnEdge +edgesOnVertex +cellsOnVertex +kiteAreasOnVertex +meshDensity +zgrid +fzm +fzp +zz +initial_time +xtime +Time +u +w +pressure +surface_pressure +rho +theta +relhum +divergence +vorticity +ke +uReconstructZonal +uReconstructMeridional +ertel_pv +u_pv +v_pv +theta_pv +vort_pv +iLev_DT +depv_dt_lw +depv_dt_sw +depv_dt_bl +depv_dt_cu +depv_dt_mix +dtheta_dt_mp +depv_dt_mp +depv_dt_diab +depv_dt_fric +depv_dt_diab_pv +depv_dt_fric_pv +i_rainnc +rainnc +precipw +cuprec +i_rainc +rainc +kpbl +hpbl +hfx +qfx +cd +cda +ck +cka +lh +u10 +v10 +q2 +t2m +th2m +gsw +glw +acsnow +pin +ozmixm +mminlu +isice_lu +iswater_lu +xland +skintemp +snow +snowh +sst +vegfra +shdmin +shdmax +canwat +xice +sh2o +smois +tslb +soilt1 +rhosnf +snowfallac +acrunoff +grdflx +ivgtyp +isltyp +lai +sfc_albedo +cldfrac_bl +snowc +snownc +graupelnc diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/stream_list.atmosphere.surface b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/stream_list.atmosphere.surface new file mode 100644 index 0000000000..db54cab459 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/stream_list.atmosphere.surface @@ -0,0 +1,2 @@ +sst +xice diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/streams.atmosphere b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/streams.atmosphere new file mode 100644 index 0000000000..b076c1bc12 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.hrrrv5.rap.winter/streams.atmosphere @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/namelist.atmosphere.gsl b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/namelist.atmosphere.gsl new file mode 100644 index 0000000000..e7cc47d8f1 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/namelist.atmosphere.gsl @@ -0,0 +1,69 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true + config_lbc_w = "zero" +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'mesoscale_reference' + config_microp_re = false +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/namelist.atmosphere.ncar b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/namelist.atmosphere.ncar new file mode 100644 index 0000000000..6229bc51dd --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/namelist.atmosphere.ncar @@ -0,0 +1,68 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'mesoscale_reference' + config_microp_re = false +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/stream_list.atmosphere.diagnostics b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/stream_list.atmosphere.diagnostics new file mode 100644 index 0000000000..4e7979fb61 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/stream_list.atmosphere.diagnostics @@ -0,0 +1,92 @@ +initial_time +xtime +olrtoa +rainc +rainnc +refl10cm_max +refl10cm_1km +refl10cm_1km_max +precipw +u10 +v10 +q2 +t2m +th2m +mslp +relhum_200hPa +relhum_250hPa +relhum_500hPa +relhum_700hPa +relhum_850hPa +relhum_925hPa +dewpoint_200hPa +dewpoint_250hPa +dewpoint_500hPa +dewpoint_700hPa +dewpoint_850hPa +dewpoint_925hPa +temperature_200hPa +temperature_250hPa +temperature_500hPa +temperature_700hPa +temperature_850hPa +temperature_925hPa +height_200hPa +height_250hPa +height_500hPa +height_700hPa +height_850hPa +height_925hPa +uzonal_200hPa +uzonal_250hPa +uzonal_500hPa +uzonal_700hPa +uzonal_850hPa +uzonal_925hPa +umeridional_200hPa +umeridional_250hPa +umeridional_500hPa +umeridional_700hPa +umeridional_850hPa +umeridional_925hPa +w_200hPa +w_250hPa +w_500hPa +w_700hPa +w_850hPa +w_925hPa +vorticity_200hPa +vorticity_250hPa +vorticity_500hPa +vorticity_700hPa +vorticity_850hPa +vorticity_925hPa +t_isobaric +t_iso_levels +z_isobaric +z_iso_levels +meanT_500_300 +cape +cin +lcl +lfc +srh_0_1km +srh_0_3km +uzonal_surface +uzonal_1km +uzonal_6km +umeridional_surface +umeridional_1km +umeridional_6km +temperature_surface +dewpoint_surface +updraft_helicity_max +w_velocity_max +wind_speed_level1_max +t_oml +t_oml_initial +t_oml_200m_initial +h_oml +h_oml_initial +hu_oml +hv_oml diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/stream_list.atmosphere.output b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/stream_list.atmosphere.output new file mode 100644 index 0000000000..24c30f010b --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/stream_list.atmosphere.output @@ -0,0 +1,110 @@ +scalars +latCell +lonCell +xCell +yCell +zCell +indexToCellID +latEdge +lonEdge +xEdge +yEdge +zEdge +indexToEdgeID +latVertex +lonVertex +xVertex +yVertex +zVertex +indexToVertexID +cellsOnEdge +nEdgesOnCell +nEdgesOnEdge +edgesOnCell +edgesOnEdge +weightsOnEdge +dvEdge +dcEdge +angleEdge +areaCell +areaTriangle +cellsOnCell +verticesOnCell +verticesOnEdge +edgesOnVertex +cellsOnVertex +kiteAreasOnVertex +meshDensity +zgrid +fzm +fzp +zz +initial_time +xtime +u +w +pressure +surface_pressure +rho +theta +relhum +divergence +vorticity +ke +uReconstructZonal +uReconstructMeridional +ertel_pv +u_pv +v_pv +theta_pv +vort_pv +depv_dt_lw +depv_dt_sw +depv_dt_bl +depv_dt_cu +depv_dt_mix +dtheta_dt_mp +depv_dt_mp +depv_dt_diab +depv_dt_fric +depv_dt_diab_pv +depv_dt_fric_pv +iLev_DT +i_rainnc +rainnc +precipw +cuprec +i_rainc +rainc +kpbl +hpbl +hfx +qfx +cd +cda +ck +cka +lh +u10 +v10 +q2 +t2m +th2m +gsw +glw +acsnow +pin +ozmixm +mminlu +isice_lu +iswater_lu +xland +skintemp +snow +snowh +sst +vegfra +xice +sh2o +smois +tslb diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/stream_list.atmosphere.surface b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/stream_list.atmosphere.surface new file mode 100644 index 0000000000..db54cab459 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/stream_list.atmosphere.surface @@ -0,0 +1,2 @@ +sst +xice diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/streams.atmosphere b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/streams.atmosphere new file mode 100644 index 0000000000..c4a888ac66 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference.gfs.winter/streams.atmosphere @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.gsl b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.gsl new file mode 100644 index 0000000000..93702c56f7 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.gsl @@ -0,0 +1,70 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true + config_lbc_w = "zero" +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'mesoscale_reference' + config_microp_re = false + config_lsm_scheme = "sf_noahmp" +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.ncar b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.ncar new file mode 100644 index 0000000000..cab4d85552 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/namelist.atmosphere.ncar @@ -0,0 +1,69 @@ +&nhyd_model + config_time_integration_order = 2 + config_dt = 720.0 + config_start_time = '2023-03-10_15:00:00' + config_run_duration = '0_01:00:00' + config_split_dynamics_transport = true + config_number_of_sub_steps = 2 + config_dynamics_split_steps = 3 + config_h_mom_eddy_visc2 = 0.0 + config_h_mom_eddy_visc4 = 0.0 + config_v_mom_eddy_visc2 = 0.0 + config_h_theta_eddy_visc2 = 0.0 + config_h_theta_eddy_visc4 = 0.0 + config_v_theta_eddy_visc2 = 0.0 + config_horiz_mixing = '2d_smagorinsky' + config_visc4_2dsmag = 0.05 + config_w_adv_order = 3 + config_theta_adv_order = 3 + config_scalar_adv_order = 3 + config_u_vadv_order = 3 + config_w_vadv_order = 3 + config_theta_vadv_order = 3 + config_scalar_vadv_order = 3 + config_scalar_advection = true + config_positive_definite = false + config_monotonic = true + config_coef_3rd_order = 0.25 + config_epssm = 0.1 + config_smdiv = 0.1 +/ +&damping + config_zd = 22000.0 + config_xnutr = 0.2 +/ +&limited_area + config_apply_lbcs = true +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = 'graph.info.part.' +/ +&restart + config_do_restart = false +/ +&printout + config_print_global_minmax_vel = true + config_print_detailed_minmax_vel = false +/ +&IAU + config_IAU_option = 'off' + config_IAU_window_length_s = 21600. +/ +&physics + config_sst_update = false + config_sstdiurn_update = false + config_deepsoiltemp_update = false + config_radtlw_interval = '00:30:00' + config_radtsw_interval = '00:30:00' + config_bucket_update = 'none' + config_physics_suite = 'mesoscale_reference' + config_microp_re = false + config_lsm_scheme = "sf_noahmp" +/ +&soundings + config_sounding_interval = 'none' +/ diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.diagnostics b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.diagnostics new file mode 100644 index 0000000000..4e7979fb61 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.diagnostics @@ -0,0 +1,92 @@ +initial_time +xtime +olrtoa +rainc +rainnc +refl10cm_max +refl10cm_1km +refl10cm_1km_max +precipw +u10 +v10 +q2 +t2m +th2m +mslp +relhum_200hPa +relhum_250hPa +relhum_500hPa +relhum_700hPa +relhum_850hPa +relhum_925hPa +dewpoint_200hPa +dewpoint_250hPa +dewpoint_500hPa +dewpoint_700hPa +dewpoint_850hPa +dewpoint_925hPa +temperature_200hPa +temperature_250hPa +temperature_500hPa +temperature_700hPa +temperature_850hPa +temperature_925hPa +height_200hPa +height_250hPa +height_500hPa +height_700hPa +height_850hPa +height_925hPa +uzonal_200hPa +uzonal_250hPa +uzonal_500hPa +uzonal_700hPa +uzonal_850hPa +uzonal_925hPa +umeridional_200hPa +umeridional_250hPa +umeridional_500hPa +umeridional_700hPa +umeridional_850hPa +umeridional_925hPa +w_200hPa +w_250hPa +w_500hPa +w_700hPa +w_850hPa +w_925hPa +vorticity_200hPa +vorticity_250hPa +vorticity_500hPa +vorticity_700hPa +vorticity_850hPa +vorticity_925hPa +t_isobaric +t_iso_levels +z_isobaric +z_iso_levels +meanT_500_300 +cape +cin +lcl +lfc +srh_0_1km +srh_0_3km +uzonal_surface +uzonal_1km +uzonal_6km +umeridional_surface +umeridional_1km +umeridional_6km +temperature_surface +dewpoint_surface +updraft_helicity_max +w_velocity_max +wind_speed_level1_max +t_oml +t_oml_initial +t_oml_200m_initial +h_oml +h_oml_initial +hu_oml +hv_oml diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.output b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.output new file mode 100644 index 0000000000..24c30f010b --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.output @@ -0,0 +1,110 @@ +scalars +latCell +lonCell +xCell +yCell +zCell +indexToCellID +latEdge +lonEdge +xEdge +yEdge +zEdge +indexToEdgeID +latVertex +lonVertex +xVertex +yVertex +zVertex +indexToVertexID +cellsOnEdge +nEdgesOnCell +nEdgesOnEdge +edgesOnCell +edgesOnEdge +weightsOnEdge +dvEdge +dcEdge +angleEdge +areaCell +areaTriangle +cellsOnCell +verticesOnCell +verticesOnEdge +edgesOnVertex +cellsOnVertex +kiteAreasOnVertex +meshDensity +zgrid +fzm +fzp +zz +initial_time +xtime +u +w +pressure +surface_pressure +rho +theta +relhum +divergence +vorticity +ke +uReconstructZonal +uReconstructMeridional +ertel_pv +u_pv +v_pv +theta_pv +vort_pv +depv_dt_lw +depv_dt_sw +depv_dt_bl +depv_dt_cu +depv_dt_mix +dtheta_dt_mp +depv_dt_mp +depv_dt_diab +depv_dt_fric +depv_dt_diab_pv +depv_dt_fric_pv +iLev_DT +i_rainnc +rainnc +precipw +cuprec +i_rainc +rainc +kpbl +hpbl +hfx +qfx +cd +cda +ck +cka +lh +u10 +v10 +q2 +t2m +th2m +gsw +glw +acsnow +pin +ozmixm +mminlu +isice_lu +iswater_lu +xland +skintemp +snow +snowh +sst +vegfra +xice +sh2o +smois +tslb diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.surface b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.surface new file mode 100644 index 0000000000..db54cab459 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/stream_list.atmosphere.surface @@ -0,0 +1,2 @@ +sst +xice diff --git a/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/streams.atmosphere b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/streams.atmosphere new file mode 100644 index 0000000000..c4a888ac66 --- /dev/null +++ b/testing_and_setup/ufs-community/cases/ufscommunity.mesoscale_reference_noahmp.gfs.winter/streams.atmosphere @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing_and_setup/ufs-community/data/get_data.sh b/testing_and_setup/ufs-community/data/get_data.sh new file mode 100755 index 0000000000..061745268d --- /dev/null +++ b/testing_and_setup/ufs-community/data/get_data.sh @@ -0,0 +1,84 @@ +#!/bin/bash + +# Function to display help message +print_help() { + echo "get_data.sh: testing_and_setup/ufs-community/data/get_data.sh [-v,--verbose]" + echo " Script for downloading/extracting the Physics lookup tables and MPAS ICs." + echo "" + echo "Options:" + echo " -v, --verbose Turn on wget verbose output." + echo " --help Show this help message and exit." +} + +verbose="-q" +# Parse command-line arguments +while [[ "$#" -gt 0 ]]; do + case $1 in + --help) + print_help + exit 0 + ;; + -v|--verbose) + verbose="-v" + ;; + *) + echo "Unknown option: $1" + print_help + exit 1 + ;; + esac + shift +done + +set -ex + +if [[ $(uname -s) == Darwin ]]; then + if [[ $(sw_vers -productVersion) < 12.3 ]]; then + MYDIR=$(cd "$(dirname "$(greadlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P) + else + MYDIR=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P) + fi +else + MYDIR=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P) +fi +BASEDIR=$MYDIR/../../.. + + +# Change to directory containing theinput data, download and extract archive +cd $BASEDIR/testing_and_setup/ufs-community/data/ + +# Get TEMPO data +wget ${verbose} https://github.com/ufs-community/MPAS-Model/releases/download/MPAS-v8.3.1-2.14/tempo_data.tar +mkdir -p tables/tempo/ +mv tempo_data.tar tables/tempo/ +cd tables/tempo +tar -xvf tempo_data.tar +rm tempo_data.tar +cd ../../ + +# Get Thompson data +wget ${verbose} https://github.com/ufs-community/MPAS-Model/releases/download/MPAS-v8.3.1-2.13/thompson_data.tar +mkdir -p tables/thompson/ +mv thompson_data.tar tables/thompson/ +cd tables/thompson +tar -xvf thompson_data.tar +rm thompson_data.tar +cd ../../ + +# Get UGW data +wget ${verbose} https://github.com/ufs-community/MPAS-Model/releases/download/MPAS-v8.3.1-2.13/ugw_data.tar +mkdir -p tables/ugw/ +mv ugw_data.tar tables/ugw/ +cd tables/ugw +tar -xvf ugw_data.tar +rm ugw_data.tar +cd ../../ + +# Get MPAS case data +wget ${verbose} https://github.com/ufs-community/MPAS-Model/releases/download/MPAS-v8.3.1-2.13/mpas_data.tar +mkdir -p ics +mv mpas_data.tar ics/ +cd ics +tar -xvf mpas_data.tar +rm mpas_data.tar +cd ../