diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e3f44db6..7427f114 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,5 +1,7 @@ # PR Summary + + Sci/Tech Reviewer: Code Reviewer: @@ -26,20 +28,16 @@ Code Reviewer: - [ ] I have performed a self-review of my own code - [ ] My code follows the project's style guidelines -- [ ] Comments have been included that aid undertanding and enhance the - readability of the code +- [ ] Comments have been included that aid understanding and enhance the readability of the code - [ ] My changes generate no new warnings - [ ] If editing `rose-meta/jules-shared` then have you supplied a linked UM and LFRic Apps PR? ## Testing - [ ] I have tested this change locally, using the JULES rose-stem suite -- [ ] If shared files have been modified, I have run the UM and LFRic Apps rose - stem suites -- [ ] If any tests fail (rose-stem or CI) the reason is understood and - acceptable (eg. kgo changes) -- [ ] I have added tests to cover new functionality as appropriate (eg. system - tests, unit tests, etc.) +- [ ] If shared files have been modified, I have run the UM and LFRic Apps rose stem suites +- [ ] If any tests fail (rose-stem or CI) the reason is understood and acceptable (eg. kgo changes) +- [ ] I have added tests to cover new functionality as appropriate (eg. system tests, unit tests, etc.) @@ -55,28 +53,21 @@ Code Reviewer: ## Performance Impact -- [ ] Performance of the code has been considered and, if applicable, suitable - performance measurements have been conducted +- [ ] Performance of the code has been considered and, if applicable, suitable performance measurements have been conducted ## AI Assistance and Attribution -- [ ] Some of the content of this change has been produced with the assistance - of _Generative AI tool name_ (e.g., Met Office Github Copilot Enterprise, - Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the - [Simulation Systems AI policy](https://metoffice.github.io/simulation-systems/FurtherDetails/ai.html) - (including attribution labels) +- [ ] Some of the content of this change has been produced with the assistance of _Generative AI tool name_ (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the [Simulation Systems AI policy](https://metoffice.github.io/simulation-systems/FurtherDetails/ai.html) (including attribution labels) ## Documentation -- [ ] Where appropriate I have updated documentation related to this change and - confirmed that it builds correctly +- [ ] Where appropriate I have updated documentation related to this change and confirmed that it builds correctly ## Approvals -Please request all relevant approvals. See the CodeOwners.txt file for section -owners. +Please request all relevant approvals. See the CodeOwners.txt file for section owners. ### Technical @@ -93,7 +84,7 @@ owners. - [ ] Hydrology - [ ] Vegetation - [ ] Veg3 RED Demography -- [ ] Biogechemistry +- [ ] Biogeochemistry - [ ] Biogenic fluxes - [ ] Fire - [ ] Lakes diff --git a/.github/workflows/check-cr-approved.yaml b/.github/workflows/check-cr-approved.yaml index 9b66712a..11fdb34c 100644 --- a/.github/workflows/check-cr-approved.yaml +++ b/.github/workflows/check-cr-approved.yaml @@ -1,11 +1,20 @@ +# ----------------------------------------------------------------------------- +# (C) Crown copyright Met Office. All rights reserved. +# The file LICENCE, distributed with this code, contains details of the terms +# under which the code may be used. +# ----------------------------------------------------------------------------- + name: Check CR approved on: - pull_request_review: - types: [submitted, edited, dismissed] - workflow_dispatch: + pull_request_review: + types: [submitted, edited, dismissed] + workflow_dispatch: jobs: - check_cr_approved: - if: ${{ github.event.pull_request.number }} - uses: MetOffice/growss/.github/workflows/check-cr-approved.yaml@main + check_cr_approved: + permissions: + contents: read # Required to evaluate the event trigger metadata safely + pull-requests: read # Required to read pull request details + if: ${{ github.event.pull_request.number }} + uses: MetOffice/growss/.github/workflows/check-cr-approved.yaml@0f9ffe6a138ae9943053621916a850a075997db8 # v1.0.0 diff --git a/.github/workflows/cla-check.yaml b/.github/workflows/cla-check.yaml index 18878145..aa7e3118 100644 --- a/.github/workflows/cla-check.yaml +++ b/.github/workflows/cla-check.yaml @@ -1,10 +1,29 @@ +# ----------------------------------------------------------------------------- +# (C) Crown copyright Met Office. All rights reserved. +# The file LICENCE, distributed with this code, contains details of the terms +# under which the code may be used. +# ----------------------------------------------------------------------------- + +# Check Contributor Licence Agreement + name: Legal on: pull_request_target: +concurrency: + # Automatically cancels the workflow run instantly before the + # engine can parse empty jobs and generate notification emails + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: ${{ github.event.pull_request.head.repo.full_name != 'MetOffice/jules' }} + +permissions: {} + jobs: cla: - uses: MetOffice/growss/.github/workflows/cla-check.yaml@main + permissions: + contents: read # Required to evaluate the event trigger metadata safely + pull-requests: write # Required for the downstream engine to post status comments on the PR + uses: MetOffice/growss/.github/workflows/cla-check.yaml@0f9ffe6a138ae9943053621916a850a075997db8 # v1.0.0 with: cla-url: 'https://github.com/MetOffice/jules/blob/main/CLA.md' diff --git a/.github/workflows/track-review-project.yaml b/.github/workflows/track-review-project.yaml index 639477cd..1ab60122 100644 --- a/.github/workflows/track-review-project.yaml +++ b/.github/workflows/track-review-project.yaml @@ -1,3 +1,9 @@ +# ----------------------------------------------------------------------------- +# (C) Crown copyright Met Office. All rights reserved. +# The file LICENCE, distributed with this code, contains details of the terms +# under which the code may be used. +# ----------------------------------------------------------------------------- + name: Track Review Project on: @@ -7,11 +13,14 @@ on: - completed permissions: - actions: read - contents: read - pull-requests: write + contents: read # Required to evaluate the event trigger metadata safely jobs: track_review_project: - uses: MetOffice/growss/.github/workflows/track-review-project.yaml@main - secrets: inherit + permissions: + actions: read # Required to check out code or parse files safely + contents: read # Required to read the upstream triggered workflow run artifact status + pull-requests: write # Required for the downstream engine to add comments or update metadata on the PR + uses: MetOffice/growss/.github/workflows/track-review-project.yaml@0f9ffe6a138ae9943053621916a850a075997db8 # v1.0.0 + secrets: + PROJECT_ACTION_PAT: ${{ secrets.PROJECT_ACTION_PAT }} diff --git a/.github/workflows/trigger-project-workflow.yaml b/.github/workflows/trigger-project-workflow.yaml index ccb7a55b..69e58c93 100644 --- a/.github/workflows/trigger-project-workflow.yaml +++ b/.github/workflows/trigger-project-workflow.yaml @@ -1,3 +1,9 @@ +# ----------------------------------------------------------------------------- +# (C) Crown copyright Met Office. All rights reserved. +# The file LICENCE, distributed with this code, contains details of the terms +# under which the code may be used. +# ----------------------------------------------------------------------------- + name: Trigger Review Project on: @@ -7,11 +13,14 @@ on: pull_request_review_comment: permissions: - actions: read - contents: read - pull-requests: write + contents: read # Required to evaluate the event trigger metadata safely jobs: trigger_project_workflow: - uses: MetOffice/growss/.github/workflows/trigger-project-workflow.yaml@main - secrets: inherit + if: github.repository == 'MetOffice/jules' + + permissions: + actions: read # Required to check out code or parse files safely + contents: read # Required to read the upstream triggered workflow run artifact status + pull-requests: write # Required for the downstream engine to add comments or update metadata on the PR + uses: MetOffice/growss/.github/workflows/trigger-project-workflow.yaml@0f9ffe6a138ae9943053621916a850a075997db8 # v1.0.0 diff --git a/.github/workflows/umdp3_fixer.yaml b/.github/workflows/umdp3_fixer.yaml index 6f265be6..da2938f5 100644 --- a/.github/workflows/umdp3_fixer.yaml +++ b/.github/workflows/umdp3_fixer.yaml @@ -1,10 +1,18 @@ +# ----------------------------------------------------------------------------- +# (C) Crown copyright Met Office. All rights reserved. +# The file LICENCE, distributed with this code, contains details of the terms +# under which the code may be used. +# ----------------------------------------------------------------------------- + name: umdp3 Fixer on: - pull_request: - types: [opened, synchronize, reopened] - workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: jobs: - umdp3_fixer: - uses: MetOffice/growss/.github/workflows/umdp3_fixer.yaml@main + umdp3_fixer: + permissions: + contents: read + uses: MetOffice/growss/.github/workflows/umdp3_fixer.yaml@0f9ffe6a138ae9943053621916a850a075997db8 # v1.0.0 diff --git a/.github/workflows/user-guide.yaml b/.github/workflows/user-guide.yaml index 345965a9..4077ef2d 100644 --- a/.github/workflows/user-guide.yaml +++ b/.github/workflows/user-guide.yaml @@ -42,33 +42,33 @@ jobs: steps: - name: Check deployment conditions id: check-deploy + env: + GH_REPOSITORY: ${{ github.repository }} + GH_REF_NAME: ${{ github.ref_name }} + GH_EVENT_NAME: ${{ github.event_name }} run: | - if [[ "${{ github.repository }}" == "MetOffice/jules" && ("${{ github.ref_name }}" == "main" || "${{ github.ref_name }}" == "stable") && ("${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "merge_group" || "${{ github.event_name }}" == "release" || "${{ github.event_name }}" == "workflow_dispatch") ]]; then + if [[ "$GH_REPOSITORY" == "MetOffice/jules" && ("$GH_REF_NAME" == "main" || "$GH_REF_NAME" == "stable") && ("$GH_EVENT_NAME" == "push" || "$GH_EVENT_NAME" == "merge_group" || "$GH_EVENT_NAME" == "release" || "$GH_EVENT_NAME" == "workflow_dispatch") ]]; then echo "should-deploy=true" >> $GITHUB_OUTPUT else echo "should-deploy=false" >> $GITHUB_OUTPUT fi - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: path: ${{ env.JULES_PATH }} # Get all refs to build historic versions fetch-depth: 0 + persist-credentials: false - name: Setup uv with Python ${{ env.PYTHON_VRSN }} - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 with: python-version: ${{ env.PYTHON_VRSN }} - - - name: Cache uv venv - uses: actions/cache@v4 - with: - path: ${{ env.VENV_PATH }} - key: ${{ runner.os }}-uv-${{ env.PYTHON_VRSN }}-${{ hashFiles('doc/pyproject.toml', 'doc/uv.lock') }} - restore-keys: | - ${{ runner.os }}-uv-${{ env.PYTHON_VRSN }}- - ${{ runner.os }}-uv- + enable-cache: false + cache-dependency-glob: | + doc/pyproject.toml + doc/uv.lock - name: Install dependencies working-directory: ${{ env.JULES_PATH }}/doc @@ -119,11 +119,11 @@ jobs: # -- Deploy to GitHub Pages only on push to upstream main - name: Setup GitHub Pages if: steps.check-deploy.outputs.should-deploy == 'true' - uses: actions/configure-pages@v5 + uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 - name: Upload artifact to GitHub Pages if: steps.check-deploy.outputs.should-deploy == 'true' - uses: actions/upload-pages-artifact@v4 + uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 with: name: github-pages path: ${{ env.OUTPUT_PATH }} @@ -133,4 +133,4 @@ jobs: - name: Deploy to GitHub Pages id: deployment if: steps.check-deploy.outputs.should-deploy == 'true' - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 diff --git a/.github/zizmor.yml b/.github/zizmor.yml new file mode 100644 index 00000000..e66c5e79 --- /dev/null +++ b/.github/zizmor.yml @@ -0,0 +1,15 @@ +# ------------------------------------------------------------------------------ +# (c) Crown copyright Met Office. All rights reserved. +# The file LICENCE, distributed with this code, contains details of the terms +# under which the code may be used. +# ------------------------------------------------------------------------------ + +# Rules for Zizmor GitHub workflow linter. This file is used to configure which +# rules to ignore for specific workflow files, allowing for exceptions to be +# made where necessary while still enforcing best practices across the codebase. +rules: + dangerous-triggers: + ignore: + - "cla-check.yaml" + - "track-review-project.yaml" + - "trigger-project-workflow.yaml" diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index db1cc110..b7cc3ef4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -5,3 +5,4 @@ | yaswant | Yaswant Pradhan | Met Office | 2026-06-30 | | doucla | Douglas Clark | UKCEH | 2026-07-03 | | james-bruten-mo | James Bruten | Met Office | 2026-07-09 | +| nicgedney | Nic Gedney | Met Office | 2026-09-10 | \ No newline at end of file diff --git a/doc/pyproject.toml b/doc/pyproject.toml index 3a2acaff..66d007c5 100644 --- a/doc/pyproject.toml +++ b/doc/pyproject.toml @@ -9,5 +9,11 @@ dependencies = [ "sphinx==8.2.3", "sphinx-lint==1.0.1", ] + +[project.urls] +repository = "https://github.com/MetOffice/jules" +documentation = "https://metoffice.github.io/jules/" +discussion = "https://github.com/MetOffice/simulation-systems/discussions/categories/jules" + [tool.setuptools] packages = [] diff --git a/doc/source/namelists/jules_hydrology.nml.rst b/doc/source/namelists/jules_hydrology.nml.rst index d67fa50a..30fd62ef 100644 --- a/doc/source/namelists/jules_hydrology.nml.rst +++ b/doc/source/namelists/jules_hydrology.nml.rst @@ -163,6 +163,33 @@ This file sets the hydrology options. It contains one namelist called :nml:lst:` FALSE Use standard wetland and surface saturation fraction calculations. + | + .. nml:member:: l_darcy_lsh_all + + :type: logical + :default: F + + TRUE + Enable Darcian fluxes between bottom soil layer and lsh groundwater layer. + + FALSE + Only gravitation drainage is allowed between bottom soil layer and the lsh groundwater layer. + | + .. nml:member:: l_calc_zw2 + + :type: logical + :default: F + + TRUE + Water table depth calculation adapted to reduce impact of root zone abstraction on its over-estimation. + FALSE + Use standard calculation of water table depth based on Koster et al 2000 which assumes that the soil moisture profile above the water table is determined from the balance between pressure head gradient and gravity. + + .. seealso:: + References: + + * Koster, R. D. (2000), A catchment-based approach to modeling land surface processes in a general circulation model 1. Model structure J. Geophys. Res. VOL. 105, NO. D20, PAGES 24,809-24,822 + .. nml:group:: Only used if :nml:mem:`JULES_HYDROLOGY::l_pdm` = TRUE diff --git a/etc/fcm-make/compiler/cray_12_plus.cfg b/etc/fcm-make/compiler/cray_12_plus.cfg index bc8fe63b..4fb0c2a0 100644 --- a/etc/fcm-make/compiler/cray_12_plus.cfg +++ b/etc/fcm-make/compiler/cray_12_plus.cfg @@ -60,4 +60,4 @@ $SOURCE_PATH_PREFIX{?} = jules build.prop{fc.flags}[$SOURCE_PATH_PREFIX/src/io/model_interface/model_interface_mod.F90] = -O0 -Ovector0 -hfp0 -hflex_mp=strict -hipa0 # # File override to circumvent compiler bug - compiler version: cce/12.0.1 -build.prop{fc.flags}[$SOURCE_PATH_PREFIX/src/initialisation/standalone/init_prescribed_data.F90] = $fflags_common -O1 +build.prop{fc.flags}[$SOURCE_PATH_PREFIX/src/initialisation/standalone/init_prescribed_data_mod.F90] = $fflags_common -O1 diff --git a/etc/fcm-make/make-river.cfg b/etc/fcm-make/make-river.cfg index 68c43e11..81789894 100644 --- a/etc/fcm-make/make-river.cfg +++ b/etc/fcm-make/make-river.cfg @@ -89,7 +89,7 @@ extract.path-incl[river] = $extract_path_incl \ src/initialisation/standalone/init_output_mod.F90 \ src/initialisation/standalone/init_rivers.F90 \ src/initialisation/standalone/init_initial_mod.F90 \ - src/initialisation/standalone/init_prescribed_data.F90 \ + src/initialisation/standalone/init_prescribed_data_mod.F90 \ src/io/dump \ src/io/file_handling \ src/io/input/fill_variables_from_file_mod.F90 \ diff --git a/etc/fcm-make/make.cfg b/etc/fcm-make/make.cfg index cf27c477..35d88747 100644 --- a/etc/fcm-make/make.cfg +++ b/etc/fcm-make/make.cfg @@ -65,11 +65,7 @@ preprocess.prop{file-ext.h} = .inc build.target = rose-run jules.exe # Explicit dependencies that need to be defined -build.prop{ns-dep.o}[jules/src/control/standalone/jules.F90] = jules/src/initialisation/standalone \ - jules/src/science \ - jules/src/control/imogen \ - jules/utils -build.prop{dep.o}[jules/src/control/standalone/jules.F90] = control.o +build.prop{ns-dep.o}[jules/src/control/standalone/jules.F90] = jules/utils ################################################################################ diff --git a/rose-meta/jules-fcm-make/versions.py b/rose-meta/jules-fcm-make/versions.py index 5fa3f750..cd2e8879 100644 --- a/rose-meta/jules-fcm-make/versions.py +++ b/rose-meta/jules-fcm-make/versions.py @@ -516,3 +516,13 @@ class vn81_vn82(MacroUpgrade): def upgrade(self, config, meta_config=None): # Nothing to do return config, self.reports + +class vn82_vn82_t138(MacroUpgrade): + """Version bump macro""" + + BEFORE_TAG = "vn8.2" + AFTER_TAG = "vn8.2_t138" + + def upgrade(self, config, meta_config=None): + # Nothing to do + return config, self.reports diff --git a/rose-meta/jules-standalone/HEAD/rose-meta.conf b/rose-meta/jules-standalone/HEAD/rose-meta.conf index e30a27c5..d4545e28 100644 --- a/rose-meta/jules-standalone/HEAD/rose-meta.conf +++ b/rose-meta/jules-standalone/HEAD/rose-meta.conf @@ -2225,6 +2225,8 @@ trigger=namelist:jules_hydrology=zw_max: .true.; = namelist:jules_hydrology=ti_wetl: .true.; = namelist:jules_hydrology=nfita: .true.; = namelist:jules_hydrology=l_wetland_unfrozen: .true.; + = namelist:jules_hydrology=l_calc_zw2: .true.; + = namelist:jules_hydrology=l_darcy_lsh_all: .true.; = namelist:jules_soil_biogeochem=ch4_substrate: .true.; = namelist:jules_soil_biogeochem=l_ch4_tlayered: .true.; = namelist:jules_soil_biogeochem=l_ch4_interactive: .true.; @@ -2239,6 +2241,20 @@ sort-key=Panel-G03a type=logical url=https://metoffice.github.io/jules/latest/namelists/jules_hydrology.nml.html#JULES_HYDROLOGY::l_wetland_unfrozen +[namelist:jules_hydrology=l_calc_zw2] +compulsory=true +description=Use updated version of water table calculation in TOPMODEL scheme +sort-key=Panel-G03a +type=logical +url=https://metoffice.github.io/jules/latest/namelists/jules_hydrology.nml.html#JULES_HYDROLOGY::l_calc_zw2 + +[namelist:jules_hydrology=l_darcy_lsh_all] +compulsory=true +description=Use full hydraulic coupling between bottom soil and groundwater layers in TOPMODEL scheme +sort-key=Panel-G03a +type=logical +url=https://metoffice.github.io/jules/latest/namelists/jules_hydrology.nml.html#JULES_HYDROLOGY::l_darcy_lsh_all + [namelist:jules_hydrology=nfita] compulsory=true description=Number of values tried in the fitting of exponential wetland/ diff --git a/rose-meta/jules-standalone/versions.py b/rose-meta/jules-standalone/versions.py index 1d4c41a9..d67fd51a 100644 --- a/rose-meta/jules-standalone/versions.py +++ b/rose-meta/jules-standalone/versions.py @@ -45,15 +45,20 @@ from .version81_82 import * -class vnYY_txxxx(MacroUpgrade): +class vn82_t1(MacroUpgrade): """Upgrade macro from JULES by Author""" - BEFORE_TAG = "vnY.Y" - AFTER_TAG = "vnY.Y_txxxx" + BEFORE_TAG = "vn8.2" + AFTER_TAG = "vn8.2_t138" + + """Issue number 138""" def upgrade(self, config, meta_config=None): """Upgrade a JULES runtime app configuration.""" - # Add settings + """Add l_calc_zw2 to namelist jules_hydrology""" + self.add_setting(config, ["namelist:jules_hydrology", "l_calc_zw2"], ".false.") + """Add l_darcy_lsh_all to namelist jules_hydrology""" + self.add_setting(config, ["namelist:jules_hydrology", "l_darcy_lsh_all"], ".false.") return config, self.reports diff --git a/src/control/imogen/clim_calc.F90 b/src/control/imogen/clim_calc_mod.F90 similarity index 98% rename from src/control/imogen/clim_calc.F90 rename to src/control/imogen/clim_calc_mod.F90 index 15ccd25d..a9959a0b 100644 --- a/src/control/imogen/clim_calc.F90 +++ b/src/control/imogen/clim_calc_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE clim_calc_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE clim_calc(land_pts, mm, md, nsdmax, seed_rain, imgn_drive, ainfo) USE missing_data_mod, ONLY: rmdi @@ -18,6 +24,7 @@ SUBROUTINE clim_calc(land_pts, mm, md, nsdmax, seed_rain, imgn_drive, ainfo) USE ancil_info, ONLY: ainfo_type USE theta_field_sizes, ONLY: t_i_length USE imogen_run, ONLY: l_daily_metdata_climatol +USE day_calc_mod, ONLY: day_calc IMPLICIT NONE @@ -47,7 +54,7 @@ SUBROUTINE clim_calc(land_pts, mm, md, nsdmax, seed_rain, imgn_drive, ainfo) ! Seeding number for subdaily rainfall. TYPE(imgn_drive_type), INTENT(IN OUT) :: imgn_drive -TYPE(ainfo_type), INTENT(IN OUT) :: ainfo +TYPE(ainfo_type), INTENT(IN) :: ainfo ! Create "subdaily" values of the arrays below using day_calc REAL :: & @@ -220,4 +227,5 @@ SUBROUTINE clim_calc(land_pts, mm, md, nsdmax, seed_rain, imgn_drive, ainfo) RETURN END SUBROUTINE clim_calc +END MODULE clim_calc_mod #endif diff --git a/src/control/imogen/day_calc.F90 b/src/control/imogen/day_calc_mod.F90 similarity index 99% rename from src/control/imogen/day_calc.F90 rename to src/control/imogen/day_calc_mod.F90 index 6f73081c..14457c6f 100644 --- a/src/control/imogen/day_calc.F90 +++ b/src/control/imogen/day_calc_mod.F90 @@ -8,6 +8,13 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE day_calc_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE day_calc( & land_pts, swdown_daily, precip_daily, tl1_daily, diurnal_tl1_daily, & lwdown_daily, pstar_daily, wind_daily, ql1_daily, swdown_subdaily, & @@ -24,6 +31,7 @@ SUBROUTINE day_calc( & USE model_grid_mod, ONLY: latitude, longitude USE theta_field_sizes, ONLY: t_i_length, t_j_length USE jules_fields_mod, ONLY: ainfo +USE rndm_mod, ONLY: rndm ! USE update_mod, ONLY: t_for_snow, t_for_con_rain ! ejb add trap in imogen nml to ensure they are read ! not activated in #1322 because metadata is a nightmare @@ -468,4 +476,5 @@ SUBROUTINE day_calc( & RETURN END SUBROUTINE day_calc +END MODULE day_calc_mod #endif diff --git a/src/control/imogen/delta_temp.F90 b/src/control/imogen/delta_temp_mod.F90 similarity index 98% rename from src/control/imogen/delta_temp.F90 rename to src/control/imogen/delta_temp_mod.F90 index 8a4e38e1..76c1c818 100644 --- a/src/control/imogen/delta_temp.F90 +++ b/src/control/imogen/delta_temp_mod.F90 @@ -8,9 +8,18 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE delta_temp_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE delta_temp( & n_olevs,f_ocean,kappa_o,lambda_l,lambda_o,mu,dqradf,dtemp_l,dtemp_o, dtemp_g) +USE invert_mod, ONLY: invert + USE veg_param, ONLY: secs_per_360days USE jules_print_mgr, ONLY: jules_message, jules_print @@ -204,4 +213,5 @@ SUBROUTINE delta_temp( & RETURN END SUBROUTINE delta_temp +END MODULE delta_temp_mod #endif diff --git a/src/control/imogen/diff_atmos_ch4.F90 b/src/control/imogen/diff_atmos_ch4_mod.F90 similarity index 97% rename from src/control/imogen/diff_atmos_ch4.F90 rename to src/control/imogen/diff_atmos_ch4_mod.F90 index 482ad9b0..81af95cd 100644 --- a/src/control/imogen/diff_atmos_ch4.F90 +++ b/src/control/imogen/diff_atmos_ch4_mod.F90 @@ -8,6 +8,13 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE diff_atmos_ch4_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE diff_atmos_ch4(d_land_atmos_ch4, ch4_ppbv) USE io_constants, ONLY: imogen_unit @@ -130,6 +137,6 @@ SUBROUTINE diff_atmos_ch4(d_land_atmos_ch4, ch4_ppbv) RETURN -END - +END SUBROUTINE diff_atmos_ch4 +END MODULE diff_atmos_ch4_mod #endif diff --git a/src/control/imogen/diffcarb_land_ch4.F90 b/src/control/imogen/diffcarb_land_ch4_mod.F90 similarity index 97% rename from src/control/imogen/diffcarb_land_ch4.F90 rename to src/control/imogen/diffcarb_land_ch4_mod.F90 index 870b604a..1e0482e9 100644 --- a/src/control/imogen/diffcarb_land_ch4.F90 +++ b/src/control/imogen/diffcarb_land_ch4_mod.F90 @@ -2,6 +2,13 @@ ! ********************************************************************* ! Calculates the global change in atmospheric CH4 ! ********************************************************************* + +MODULE diffcarb_land_ch4_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE diffcarb_land_ch4(land_pts, d_land_atmos_ch4, darea, dctot_ch4) USE imogen_run, ONLY: fch4_ref, yr_fch4_ref @@ -78,4 +85,5 @@ SUBROUTINE diffcarb_land_ch4(land_pts, d_land_atmos_ch4, darea, dctot_ch4) RETURN END SUBROUTINE diffcarb_land_ch4 +END MODULE diffcarb_land_ch4_mod #endif diff --git a/src/control/imogen/diffcarb_land_co2.F90 b/src/control/imogen/diffcarb_land_co2_mod.F90 similarity index 96% rename from src/control/imogen/diffcarb_land_co2.F90 rename to src/control/imogen/diffcarb_land_co2_mod.F90 index b7ddc70d..0de89113 100644 --- a/src/control/imogen/diffcarb_land_co2.F90 +++ b/src/control/imogen/diffcarb_land_co2_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE diffcarb_land_co2_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE diffcarb_land_co2(land_pts, d_land_atmos_co2, darea, dctot_co2) USE conversions_mod, ONLY: conv_gtc_to_ppm @@ -66,4 +72,5 @@ SUBROUTINE diffcarb_land_co2(land_pts, d_land_atmos_co2, darea, dctot_co2) RETURN END SUBROUTINE diffcarb_land_co2 +END MODULE diffcarb_land_co2_mod #endif diff --git a/src/control/imogen/drdat.F90 b/src/control/imogen/drdat_mod.F90 similarity index 98% rename from src/control/imogen/drdat.F90 rename to src/control/imogen/drdat_mod.F90 index 1ddd8852..f09dd436 100644 --- a/src/control/imogen/drdat.F90 +++ b/src/control/imogen/drdat_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE drdat_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE drdat(iyear) USE fill_variables_from_file_mod, ONLY: fill_variables_from_file @@ -82,4 +88,5 @@ SUBROUTINE drdat(iyear) RETURN END SUBROUTINE drdat +END MODULE drdat_mod #endif diff --git a/src/control/imogen/imogen_check.F90 b/src/control/imogen/imogen_check_mod.F90 similarity index 99% rename from src/control/imogen/imogen_check.F90 rename to src/control/imogen/imogen_check_mod.F90 index 5e73444d..fd3632b6 100644 --- a/src/control/imogen/imogen_check.F90 +++ b/src/control/imogen/imogen_check_mod.F90 @@ -8,6 +8,13 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE imogen_check_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE imogen_check( & c_emissions, include_co2, include_non_co2_radf, land_feed_co2, & land_feed_ch4, ocean_feed, change_metdata_method, l_change_metdata) @@ -284,4 +291,5 @@ SUBROUTINE imogen_check( & RETURN END SUBROUTINE imogen_check +END MODULE imogen_check_mod #endif diff --git a/src/control/imogen/imogen_update_carb.F90 b/src/control/imogen/imogen_update_carb_mod.F90 similarity index 97% rename from src/control/imogen/imogen_update_carb.F90 rename to src/control/imogen/imogen_update_carb_mod.F90 index 5c9a7a73..2381de98 100644 --- a/src/control/imogen/imogen_update_carb.F90 +++ b/src/control/imogen/imogen_update_carb_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE imogen_update_carb_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE imogen_update_carb(progs, imgn_vars) USE model_grid_mod, ONLY: grid_area_ij @@ -42,6 +48,14 @@ SUBROUTINE imogen_update_carb(progs, imgn_vars) USE imogen_io_vars, ONLY: & yr_emiss,c_emiss +USE diffcarb_land_co2_mod, ONLY: diffcarb_land_co2 + +USE ocean_co2_mod, ONLY: ocean_co2 + +USE diffcarb_land_ch4_mod, ONLY: diffcarb_land_ch4 + +USE diff_atmos_ch4_mod, ONLY: diff_atmos_ch4 + USE logging_mod, ONLY: log_fatal !TYPE definitions @@ -246,4 +260,5 @@ SUBROUTINE imogen_update_carb(progs, imgn_vars) RETURN END SUBROUTINE imogen_update_carb +END MODULE imogen_update_carb_mod #endif diff --git a/src/control/imogen/imogen_update_clim.F90 b/src/control/imogen/imogen_update_clim_mod.F90 similarity index 96% rename from src/control/imogen/imogen_update_clim.F90 rename to src/control/imogen/imogen_update_clim_mod.F90 index 67ab8a0f..75a43973 100644 --- a/src/control/imogen/imogen_update_clim.F90 +++ b/src/control/imogen/imogen_update_clim_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE imogen_update_clim_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE imogen_update_clim(progs, imgn_drive, imgn_vars, ainfo) USE model_time_mod, ONLY: current_time @@ -34,6 +40,20 @@ SUBROUTINE imogen_update_clim(progs, imgn_drive, imgn_vars, ainfo) USE imogen_constants, ONLY: n_olevs +USE radf_co2_mod, ONLY: radf_co2 + +USE radf_non_co2_mod, ONLY: radf_non_co2 + +USE radf_ch4_mod, ONLY: radf_ch4 + +USE delta_temp_mod, ONLY: delta_temp + +USE pattern_scaling_mod, ONLY: pattern_scaling + +USE drdat_mod, ONLY: drdat + +USE clim_calc_mod, ONLY: clim_calc + USE logging_mod, ONLY: log_fatal USE jules_print_mgr, ONLY: & @@ -269,4 +289,5 @@ SUBROUTINE imogen_update_clim(progs, imgn_drive, imgn_vars, ainfo) RETURN END SUBROUTINE imogen_update_clim +END MODULE imogen_update_clim_mod #endif diff --git a/src/control/imogen/invert.F90 b/src/control/imogen/invert_mod.F90 similarity index 98% rename from src/control/imogen/invert.F90 rename to src/control/imogen/invert_mod.F90 index aee39e19..d40198a9 100644 --- a/src/control/imogen/invert.F90 +++ b/src/control/imogen/invert_mod.F90 @@ -8,6 +8,13 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE invert_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE invert( & u_old,u_new,p,lambda_old,lambda_new,r1,r2,dz_top,n_olevs & ) @@ -184,4 +191,5 @@ SUBROUTINE invert( & RETURN END SUBROUTINE invert +END MODULE invert_mod #endif diff --git a/src/control/imogen/ocean_co2.F90 b/src/control/imogen/ocean_co2_mod.F90 similarity index 98% rename from src/control/imogen/ocean_co2.F90 rename to src/control/imogen/ocean_co2_mod.F90 index 2f7ba51d..f4e7326b 100644 --- a/src/control/imogen/ocean_co2.F90 +++ b/src/control/imogen/ocean_co2_mod.F90 @@ -9,12 +9,20 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE ocean_co2_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE ocean_co2( & iyear,year_co2,co2_atmos_ppmv,co2_atmos_init_ppmv,dt_ocean, & fa_ocean,ocean_area,grad_co2_atmos_ppmv,year_run, & t_ocean_init,nfarray,d_ocean_atmos & ) +USE response_mod, ONLY: response + USE jules_print_mgr, ONLY: & jules_message, & jules_print @@ -202,4 +210,5 @@ SUBROUTINE ocean_co2( & RETURN END SUBROUTINE ocean_co2 +END MODULE ocean_co2_mod #endif diff --git a/src/control/imogen/gcm_anlg.F90 b/src/control/imogen/pattern_scaling_mod.F90 similarity index 97% rename from src/control/imogen/gcm_anlg.F90 rename to src/control/imogen/pattern_scaling_mod.F90 index c31e8bb4..5e9fc227 100644 --- a/src/control/imogen/gcm_anlg.F90 +++ b/src/control/imogen/pattern_scaling_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE pattern_scaling_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE pattern_scaling(land_pts, mm, dtemp_g, imgn_drive, ainfo) USE imgn_drive_mod, ONLY: imgn_drive_type @@ -77,4 +83,5 @@ SUBROUTINE pattern_scaling(land_pts, mm, dtemp_g, imgn_drive, ainfo) RETURN END SUBROUTINE pattern_scaling +END MODULE pattern_scaling_mod #endif diff --git a/src/control/imogen/radf_ch4.F90 b/src/control/imogen/radf_ch4_mod.F90 similarity index 98% rename from src/control/imogen/radf_ch4.F90 rename to src/control/imogen/radf_ch4_mod.F90 index 4ad2600b..19eedab6 100644 --- a/src/control/imogen/radf_ch4.F90 +++ b/src/control/imogen/radf_ch4_mod.F90 @@ -8,6 +8,13 @@ ! ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** + +MODULE radf_ch4_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE radf_ch4(ch4_ppbv, q_ch4) USE io_constants, ONLY: imogen_unit @@ -124,8 +131,6 @@ SUBROUTINE calc_q_ch4(ch4_ppbv, ch4_interp_ppbv, n2o_interp_ppbv, q_ch4) ! Local parameters REAL :: & - overlap, & - ! overlap function. olap, & ! overlap fn output with modelled ch4 conc olap_interp ! overlap fn output with reference ch4 conc. @@ -169,4 +174,5 @@ FUNCTION overlap(ch4_ppbv, n2o_ppbv) RESULT(overlap_val) + (5.31e-15 * ch4_ppbv * (ch4_ppbv * n2o_ppbv)** 1.52)) END FUNCTION overlap +END MODULE radf_ch4_mod #endif diff --git a/src/control/imogen/radf_co2.F90 b/src/control/imogen/radf_co2_mod.F90 similarity index 95% rename from src/control/imogen/radf_co2.F90 rename to src/control/imogen/radf_co2_mod.F90 index 93914e9f..a2449b55 100644 --- a/src/control/imogen/radf_co2.F90 +++ b/src/control/imogen/radf_co2_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE radf_co2_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE radf_co2(co2, co2ref, q2co2, q_co2) IMPLICIT NONE @@ -41,4 +47,5 @@ SUBROUTINE radf_co2(co2, co2ref, q2co2, q_co2) RETURN END SUBROUTINE radf_co2 +END MODULE radf_co2_mod #endif diff --git a/src/control/imogen/radf_non_co2.F90 b/src/control/imogen/radf_non_co2_mod.F90 similarity index 98% rename from src/control/imogen/radf_non_co2.F90 rename to src/control/imogen/radf_non_co2_mod.F90 index 7da2c5fd..b7f8ae02 100644 --- a/src/control/imogen/radf_non_co2.F90 +++ b/src/control/imogen/radf_non_co2_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE radf_non_co2_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE radf_non_co2( & year,q,nyr_non_co2,file_non_co2_radf) @@ -110,4 +116,5 @@ SUBROUTINE radf_non_co2( & RETURN END SUBROUTINE radf_non_co2 +END MODULE radf_non_co2_mod #endif diff --git a/src/control/imogen/response.F90 b/src/control/imogen/response_mod.F90 similarity index 97% rename from src/control/imogen/response.F90 rename to src/control/imogen/response_mod.F90 index ffe2bcbe..c7fd9b61 100644 --- a/src/control/imogen/response.F90 +++ b/src/control/imogen/response_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE response_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE response(ncallyr,year_run,rs) IMPLICIT NONE @@ -60,4 +66,5 @@ SUBROUTINE response(ncallyr,year_run,rs) RETURN END SUBROUTINE response +END MODULE response_mod #endif diff --git a/src/control/imogen/rndm.F90 b/src/control/imogen/rndm_mod.F90 similarity index 96% rename from src/control/imogen/rndm.F90 rename to src/control/imogen/rndm_mod.F90 index ce0d4120..a465a117 100644 --- a/src/control/imogen/rndm.F90 +++ b/src/control/imogen/rndm_mod.F90 @@ -9,6 +9,12 @@ ! [Met Office Ref SC0237] !******************************COPYRIGHT************************************** +MODULE rndm_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE rndm(random_num,seed) IMPLICIT NONE @@ -64,4 +70,5 @@ SUBROUTINE rndm(random_num,seed) RETURN END SUBROUTINE rndm +END MODULE rndm_mod #endif diff --git a/src/control/rivers-standalone/river.F90 b/src/control/rivers-standalone/river.F90 index 55bf51b1..dcb32c86 100644 --- a/src/control/rivers-standalone/river.F90 +++ b/src/control/rivers-standalone/river.F90 @@ -33,7 +33,7 @@ PROGRAM river USE jules_print_mgr, ONLY: jules_message, jules_print -USE control_mod, ONLY: control +USE rivers_control_mod, ONLY: rivers_control !TYPE definitions USE jules_fields_mod, ONLY: psparms_data, psparms, & @@ -143,7 +143,7 @@ PROGRAM river !----------------------------------------------------------------------------- ! Call the main model science routine !----------------------------------------------------------------------------- - CALL control( & + CALL rivers_control( & !TYPES containing field data (IN OUT) psparms, ainfo, progs, fluxes, rivers, wtrac_jls ) diff --git a/src/control/rivers-standalone/control_mod.F90 b/src/control/rivers-standalone/rivers_control_mod.F90 similarity index 97% rename from src/control/rivers-standalone/control_mod.F90 rename to src/control/rivers-standalone/rivers_control_mod.F90 index 14d32fa3..b91f5257 100644 --- a/src/control/rivers-standalone/control_mod.F90 +++ b/src/control/rivers-standalone/rivers_control_mod.F90 @@ -1,4 +1,4 @@ -MODULE control_mod +MODULE rivers_control_mod ! *****************************COPYRIGHT**************************************** ! (c) Crown copyright, Met Office. All rights reserved. ! @@ -14,13 +14,13 @@ MODULE control_mod PRIVATE -PUBLIC :: control +PUBLIC :: rivers_control -CHARACTER(LEN=*), PARAMETER, PRIVATE :: ModuleName='CONTROL_MOD' +CHARACTER(LEN=*), PARAMETER, PRIVATE :: ModuleName='RIVERS_CONTROL_MOD' CONTAINS -SUBROUTINE control ( & +SUBROUTINE rivers_control ( & !TYPES containing field data (IN OUT) psparms, ainfo, progs, fluxes, river, wtrac_jls ) @@ -185,6 +185,6 @@ SUBROUTINE control ( & CALL jules_print(RoutineName, jules_message) END SELECT -END SUBROUTINE control +END SUBROUTINE rivers_control -END MODULE control_mod +END MODULE rivers_control_mod diff --git a/src/control/shared/jules_hydrology_mod.F90 b/src/control/shared/jules_hydrology_mod.F90 index f1d360b4..1094f9d0 100644 --- a/src/control/shared/jules_hydrology_mod.F90 +++ b/src/control/shared/jules_hydrology_mod.F90 @@ -47,9 +47,13 @@ MODULE jules_hydrology_mod ! Only used if l_top=.T. l_limit_gsoil = .FALSE., & ! Switch for limiting gsoil above theta_crit - l_inland = .FALSE. + l_inland = .FALSE., & ! Switch for putting inland water from from rivers into soil moisture - + l_calc_zw2 = .FALSE., & + ! Switch for using the updated water table depth calculation + l_darcy_lsh_all = .FALSE. + ! Switch for allowing full two-way hydraulic conductivity between bottom + ! soil layer and "groundwater" lsh layer !----------------------------------------------------------------------------- ! PDM parameters !----------------------------------------------------------------------------- @@ -86,8 +90,8 @@ MODULE jules_hydrology_mod NAMELIST / jules_hydrology/ & l_hydrology, l_top, l_pdm, l_spdmvar, l_baseflow_corr, l_var_rainfrac, & l_wetland_unfrozen, l_limit_gsoil, l_inland, & - dz_pdm, b_pdm, s_pdm, slope_pdm_max, ti_max, ti_wetl, zw_max, nfita - + dz_pdm, b_pdm, s_pdm, slope_pdm_max, ti_max, ti_wetl, zw_max, nfita, & + l_calc_zw2, l_darcy_lsh_all CHARACTER(LEN=*), PARAMETER, PRIVATE :: ModuleName='JULES_HYDROLOGY_MOD' diff --git a/src/control/standalone/jules.F90 b/src/control/standalone/jules.F90 index fd1f8ae8..72972741 100644 --- a/src/control/standalone/jules.F90 +++ b/src/control/standalone/jules.F90 @@ -10,6 +10,8 @@ PROGRAM jules !$ USE omp_lib, ONLY: omp_get_max_threads +USE standalone_control_mod, ONLY: standalone_control + USE init_mod, ONLY: init USE io_constants, ONLY: max_file_name_len @@ -72,6 +74,8 @@ PROGRAM jules work_vars_data_cbl, work_vars_cbl USE imgn_drive_mod, ONLY: imgn_drive_data, imgn_drive USE imgn_vars_mod, ONLY: imgn_vars_data, imgn_vars +USE imogen_update_clim_mod, ONLY: imogen_update_clim +USE imogen_update_carb_mod, ONLY: imogen_update_carb IMPLICIT NONE @@ -191,7 +195,7 @@ PROGRAM jules !----------------------------------------------------------------------------- ! Call the main model science routine !----------------------------------------------------------------------------- - CALL control( & + CALL standalone_control( & ! Scalar arguments (INTENT IN) timestep_number, & ! Forcing (INTENT IN) diff --git a/src/control/standalone/control.F90 b/src/control/standalone/standalone_control_mod.F90 similarity index 99% rename from src/control/standalone/control.F90 rename to src/control/standalone/standalone_control_mod.F90 index 0542a79b..97703a60 100644 --- a/src/control/standalone/control.F90 +++ b/src/control/standalone/standalone_control_mod.F90 @@ -1,5 +1,12 @@ #if !defined(UM_JULES) -SUBROUTINE control ( & + +MODULE standalone_control_mod + +IMPLICIT NONE + +CONTAINS + +SUBROUTINE standalone_control ( & ! Scalar arguments (INTENT IN) timestep_number, & u_1_ij, v_1_ij, & @@ -911,5 +918,6 @@ SUBROUTINE control ( & work_cbl & ) -END SUBROUTINE control +END SUBROUTINE standalone_control +END MODULE standalone_control_mod #endif diff --git a/src/initialisation/standalone/init_fire.F90 b/src/initialisation/standalone/init_fire_mod.F90 similarity index 98% rename from src/initialisation/standalone/init_fire.F90 rename to src/initialisation/standalone/init_fire_mod.F90 index 8681971f..c57a6c1c 100644 --- a/src/initialisation/standalone/init_fire.F90 +++ b/src/initialisation/standalone/init_fire_mod.F90 @@ -5,6 +5,12 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT************************************** +MODULE init_fire_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE init_fire(nml_dir,land_index) USE io_constants, ONLY: namelist_unit @@ -100,4 +106,5 @@ SUBROUTINE init_fire(nml_dir,land_index) RETURN END SUBROUTINE init_fire +END MODULE init_fire_mod #endif diff --git a/src/initialisation/standalone/init_imogen.F90 b/src/initialisation/standalone/init_imogen_mod.F90 similarity index 99% rename from src/initialisation/standalone/init_imogen.F90 rename to src/initialisation/standalone/init_imogen_mod.F90 index e9e3e1b2..d02ff279 100644 --- a/src/initialisation/standalone/init_imogen.F90 +++ b/src/initialisation/standalone/init_imogen_mod.F90 @@ -5,6 +5,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT************************************** +MODULE init_imogen_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE init_imogen(nml_dir, progs_data, trifctltype, imgn_drive, & imgn_vars, ainfo) @@ -39,6 +44,8 @@ SUBROUTINE init_imogen(nml_dir, progs_data, trifctltype, imgn_drive, & USE imogen_anlg_vals, ONLY: imogen_anlg_vals_list, file_clim, file_patt, & diff_frac_const_imogen +USE imogen_check_mod, ONLY: imogen_check + USE imogen_io_vars, ONLY: nyr_max, yr_emiss, c_emiss USE aero, ONLY: co2_mmr @@ -386,4 +393,5 @@ SUBROUTINE init_imogen(nml_dir, progs_data, trifctltype, imgn_drive, & RETURN END SUBROUTINE init_imogen +END MODULE init_imogen_mod #endif diff --git a/src/initialisation/standalone/init_irrigation.F90 b/src/initialisation/standalone/init_irrigation_mod.F90 similarity index 97% rename from src/initialisation/standalone/init_irrigation.F90 rename to src/initialisation/standalone/init_irrigation_mod.F90 index d3ab3d14..434d8c04 100644 --- a/src/initialisation/standalone/init_irrigation.F90 +++ b/src/initialisation/standalone/init_irrigation_mod.F90 @@ -5,6 +5,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT************************************** +MODULE init_irrigation_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE init_irrigation(nml_dir) @@ -79,4 +84,5 @@ SUBROUTINE init_irrigation(nml_dir) RETURN END SUBROUTINE init_irrigation +END MODULE init_irrigation_mod #endif diff --git a/src/initialisation/standalone/init.F90 b/src/initialisation/standalone/init_mod.F90 similarity index 98% rename from src/initialisation/standalone/init.F90 rename to src/initialisation/standalone/init_mod.F90 index f96a37ed..f94cdc16 100644 --- a/src/initialisation/standalone/init.F90 +++ b/src/initialisation/standalone/init_mod.F90 @@ -5,7 +5,11 @@ ! *****************************COPYRIGHT************************************** MODULE init_mod + +IMPLICIT NONE + CONTAINS + SUBROUTINE init(nml_dir, crop_vars_data, crop_vars, & psparms_data, psparms, & toppdm, top_pdm_data, & @@ -72,6 +76,12 @@ SUBROUTINE init(nml_dir, crop_vars_data, crop_vars, & USE check_compatible_options_mod, ONLY: check_compatible_options USE init_deposition_mod, ONLY: init_deposition USE jules_science_fixes_mod, ONLY: init_science_fixes +USE init_irrigation_mod, ONLY: init_irrigation +USE init_urban_mod, ONLY: init_urban +USE init_fire_mod, ONLY: init_fire +USE init_imogen_mod, ONLY: init_imogen +USE init_prescribed_data_mod, ONLY: init_prescribed_data +USE init_vars_tmp_mod, ONLY: init_vars_tmp ! Get fields for veg3_init USE jules_surface_types_mod, ONLY: npft, nnpft, ntype diff --git a/src/initialisation/standalone/init_prescribed_data.F90 b/src/initialisation/standalone/init_prescribed_data_mod.F90 similarity index 99% rename from src/initialisation/standalone/init_prescribed_data.F90 rename to src/initialisation/standalone/init_prescribed_data_mod.F90 index 7853b085..f6d24f4a 100644 --- a/src/initialisation/standalone/init_prescribed_data.F90 +++ b/src/initialisation/standalone/init_prescribed_data_mod.F90 @@ -5,6 +5,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT************************************** +MODULE init_prescribed_data_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE init_prescribed_data(nml_dir) @@ -729,4 +734,5 @@ SUBROUTINE init_prescribed_data(nml_dir) RETURN END SUBROUTINE init_prescribed_data +END MODULE init_prescribed_data_mod #endif diff --git a/src/initialisation/standalone/init_urban.F90 b/src/initialisation/standalone/init_urban_mod.F90 similarity index 94% rename from src/initialisation/standalone/init_urban.F90 rename to src/initialisation/standalone/init_urban_mod.F90 index cb6edbfb..9026af19 100644 --- a/src/initialisation/standalone/init_urban.F90 +++ b/src/initialisation/standalone/init_urban_mod.F90 @@ -5,6 +5,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT************************************** +MODULE init_urban_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE init_urban(nml_dir) @@ -39,4 +44,5 @@ SUBROUTINE init_urban(nml_dir) RETURN END SUBROUTINE init_urban +END MODULE init_urban_mod #endif diff --git a/src/initialisation/standalone/init_vars_tmp.F90 b/src/initialisation/standalone/init_vars_tmp_mod.F90 similarity index 99% rename from src/initialisation/standalone/init_vars_tmp.F90 rename to src/initialisation/standalone/init_vars_tmp_mod.F90 index c0dc8c05..d6a27cb8 100644 --- a/src/initialisation/standalone/init_vars_tmp.F90 +++ b/src/initialisation/standalone/init_vars_tmp_mod.F90 @@ -1,5 +1,11 @@ #if !defined(UM_JULES) +MODULE init_vars_tmp_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE init_vars_tmp(crop_vars,psparms,toppdm,ainfo,trif_vars, aerotype, & progs, trifctltype, coast, jules_vars, & !fluxes, & @@ -323,4 +329,5 @@ SUBROUTINE init_vars_tmp(crop_vars,psparms,toppdm,ainfo,trif_vars, aerotype, & RETURN END SUBROUTINE init_vars_tmp +END MODULE init_vars_tmp_mod #endif diff --git a/src/science/soil/calc_zw2_jls_mod.F90 b/src/science/soil/calc_zw2_jls_mod.F90 new file mode 100644 index 00000000..23ca3249 --- /dev/null +++ b/src/science/soil/calc_zw2_jls_mod.F90 @@ -0,0 +1,321 @@ +#if !defined(RECON) +! *****************************COPYRIGHT******************************* +! (C) Crown copyright Met Office. All rights reserved. +! For further details please refer to the file COPYRIGHT.txt +! which you should have received as part of this distribution. +! *****************************COPYRIGHT******************************* +! Subroutine CALC_ZW2------------------------------------------------ + +! Purpose: To calculate the mean water table depth from the soil +! moisture deficit. This is based on Koster et al., 2000., +! whereby the soil moisture profile above the water table +! is inferred from the balance between pressure head +! pressure head gradient and gravity, and using the +! Newton-Raphson method the water table depth is +! then estimated (as in calc_zw_mod). +! In this routine, instead of using the total column +! moisture deficit, the water table is estimated "upto" +! each soil layer by considering the soil moisture deficit +! up to that soil layer. These separate estimates are +! then merged. This generally simulates a higher water +! table as it reduces the impact of root zone abstraction, +! which is not considered in Koster et al., 2000. + + +! Documentation: UNIFIED MODEL DOCUMENTATION PAPER NO 25 + +MODULE calc_zw2_mod +CHARACTER(LEN=*), PARAMETER, PRIVATE :: ModuleName='CALC_ZW2_MOD' + +CONTAINS + +SUBROUTINE calc_zw2(npnts, nshyd, soil_pts, soil_index, & + bexp, sathh, smcl, smclzw, smclsat, smclsatzw, v_sat, zw) + +USE water_constants_mod, ONLY: rho_water +USE jules_hydrology_mod, ONLY: zw_max +USE jules_soil_mod, ONLY: dzsoil + +USE parkind1, ONLY: jprb, jpim +USE yomhook, ONLY: lhook, dr_hook + +USE um_types, ONLY: real_jlslsm + +IMPLICIT NONE + +!Subroutine arguments +!----------------------------------------------------------------------------- +! Scalar arguments with intent(IN): +!----------------------------------------------------------------------------- +INTEGER, INTENT(IN) :: & + npnts, & + ! Number of gridpoints. + nshyd, & + ! Number of soil moisture levels. + soil_pts + ! Number of soil points. + +!----------------------------------------------------------------------------- +! Array arguments with intent(IN): +!----------------------------------------------------------------------------- +INTEGER, INTENT(IN) :: & + soil_index(npnts) + ! Array of soil points. + +REAL(KIND=real_jlslsm), INTENT(IN) :: & + bexp(npnts,nshyd), & + ! Clapp-Hornberger or Brooks & Corey exponent. + sathh(npnts,nshyd), & + ! Saturated soil water pressure (m). + smcl(npnts,nshyd), & + ! Total soil moisture contents of each layer (kg/m2). + smclsat(npnts,nshyd), & + ! Soil moisture contents of each layer at saturation (kg/m2). + smclzw(npnts), & + ! Moisture content in deep layer (kg/m2). + smclsatzw(npnts), & + ! Moisture content in deep layer at saturation (kg/m2). + v_sat(npnts,nshyd) + ! Volumetric soil moisture concentration at saturation (m3 H2O/m3 soil). + +!----------------------------------------------------------------------------- +! Array arguments with intent(INOUT): +!----------------------------------------------------------------------------- +REAL(KIND=real_jlslsm), INTENT(IN OUT) :: & + zw(npnts) + ! Water table depth (m). + +!----------------------------------------------------------------------------- +! Local parameters. +!----------------------------------------------------------------------------- +INTEGER, PARAMETER :: niter = 10 + ! Number of iterations. + +!----------------------------------------------------------------------------- +! Local scalar variables: +!----------------------------------------------------------------------------- +INTEGER :: & + i, j, n, it, nn, nnd, nu, & + !Loop counters + nzw ! soil layer with water table in + +REAL(KIND=real_jlslsm) :: & + zw_l_min, & + !zw from last timestep/iteration. + wgt_tot, & + ! weighting used to calculate overall water table depth. + dwgt_tot, & + ! weighting used to calculate overall water table depth. + fn, & + !fn calc in Newton-Raphson iteration. + dfn, & + !derivative of fn. + fnnew, & + !used when Newton-Raphson iteration cannot be applied as dfn is too small + zwest, & + ! estimated water table depth in iteration + zwestnn, & + ! estimated water table depth in iteration upto a specific soil layer + smd, & + !soil moisture deficit to top of soil layer + sm + !soil moisture column to top of soil layer + +!----------------------------------------------------------------------------- +! Local array variables: +!----------------------------------------------------------------------------- +REAL(KIND=real_jlslsm) :: & + wgt(nshyd+1), & + ! weighting to estimate water table from individual layer estimates + zw_l(npnts,nshyd+1), & + ! water table estimate for each layer + zdepth(0:nshyd+1), & + ! Lower soil layer boundary depth (m). + psisat(nshyd) + !Saturated soil water pressure (m) (negative). + +!----------------------------------------------------------------------------- +INTEGER(KIND=jpim), PARAMETER :: zhook_in = 0 +INTEGER(KIND=jpim), PARAMETER :: zhook_out = 1 +REAL(KIND=jprb) :: zhook_handle + +CHARACTER(LEN=*), PARAMETER :: RoutineName='CALC_ZW2' + +IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_in,zhook_handle) + +zdepth(:) = 0.0 +DO n=1,nshyd + zdepth(n) = zdepth(n-1)+dzsoil(n) +END DO +zdepth(nshyd+1) = zw_max + +!----------------------------------------------------------------------------- +!$OMP PARALLEL DO & +!$OMP SCHEDULE(STATIC) & +!$OMP DEFAULT(NONE) & +!$OMP PRIVATE(j,i,smd,sm,psisat,zwest,it,fn,dfn,fnnew,nu,nn,zwestnn, & +!$OMP zw_l,zw_l_min,wgt_tot,wgt,dwgt_tot,nzw,nnd,n) & +!$OMP SHARED(soil_pts,soil_index,zw,smclsat,smcl,smclsatzw,smclzw,sathh,bexp, & +!$OMP v_sat,nshyd,zw_max,zdepth) + +DO j = 1,soil_pts + i = soil_index(j) + + !--------------------------------------------------------------------------- + ! For each layer (n) estimate water table depth assuming an equilibrium + ! profile from above water table to the top of that layer + ! (equilibrium profile is when pressure head gradient and gravity balance): + !--------------------------------------------------------------------------- + + DO n = nshyd+1,1,-1 + !------------------------------------------------------------------------- + ! Calculate total soil moisture deficit to the top of the current layer: + !------------------------------------------------------------------------- + smd = ((smclsatzw(i) - smclzw(i)) / rho_water) + sm = (smclsatzw(i) / rho_water) + DO nn = n,nshyd + smd = smd + ((smclsat(i,nn) - smcl(i,nn)) / rho_water) + sm = sm + smclsat(i,nn) / rho_water + END DO + smd = MAX(smd,0.0) + + psisat(:) = -sathh(i,:) + zwest = zw(i) + + DO it = 1,niter + + !----------------------------------------------------------------------- + ! Find layer with current water table estimate in it: + !----------------------------------------------------------------------- + nzw = nshyd+1 + DO nn = nshyd+1,1,-1 + IF (zwest <= zdepth(nn) .AND. nn < nzw) THEN + nzw = nn + END IF + END DO + + nzw = MAX(n,nzw) + zwest = MAX(zwest,zdepth(n-1)) + + !----------------------------------------------------------------------- + ! Newton-Raphson. zw(next)=zw-f(zw)/f'(zw). + !----------------------------------------------------------------------- + fn = - smd + DO nn = n,nzw + nnd = MIN(nn,nshyd) ! The deep LSH layer has same soil params as nshyd + IF (nn < nzw) THEN + zwestnn = zdepth(nn) + ELSE + zwestnn = zwest + dfn = v_sat(i,nnd) - v_sat(i,nnd) * & + ( 1.0 - zwestnn / psisat(nnd) )** (-1.0 / bexp(i,nnd)) + END IF + fn = fn + (zwestnn - zdepth(nn-1)) * v_sat(i,nnd) & + - v_sat(i,nnd) * bexp(i,nnd) / (bexp(i,nnd) - 1.0) * psisat(nnd) & + * ( (1.0 - zdepth(nn-1) / psisat(nnd) )** & + ( 1.0 - 1.0 / bexp(i,nnd) ) & + - (1.0 - zwestnn / psisat(nnd) )** & + ( 1.0 - 1.0 / bexp(i,nnd) ) ) ! f(zw) + END DO + + IF (ABS(dfn) > EPSILON(dfn)) THEN + zwest = zwest - fn / dfn + ELSE + ! Else assume estimate correct from equation. So no need to iterate: + nu = MIN(nshyd,nzw) + fnnew = fn + smd - zwest* v_sat(i,nu) + zwest = (smd-fnnew)/v_sat(i,nu) + END IF + + IF (zwest < 0.0) THEN + zwest = 0.0 + END IF + IF (zwest > zw_max) THEN + zwest = zw_max + END IF + END DO ! iterations + + zw_l(i,n) = MAX(zwest,zdepth(n-1)) + + END DO ! layers + + !----------------------------------------------------------------------- + ! find layer with water table depth for smallest zw_l estimate: + !----------------------------------------------------------------------- + zw_l_min = zw_max + DO n=1,nshyd+1 + zw_l_min = MIN(zw_l_min,zw_l(i,n)) + END DO + + nzw = nshyd+1 + DO n = nshyd+1,1,-1 + IF (zw_l(i,n) == zw_l_min) THEN + nzw = n + END IF + END DO + nzw = MAX(1,nzw) + + !----------------------------------------------------------------------- + ! Water table taken as minimum estimated from water table layer + ! and the layers below: + !----------------------------------------------------------------------- + IF (nzw < nshyd+1) THEN + DO n = nzw+1,nshyd+1,1 + zw_l(i,n) = MIN(zw_l(i,n),zw_l(i,nzw)) + END DO + END IF + + zw(i)=0.0 + wgt_tot=0.0 + wgt(:)=0.0 + + !--------------------------------------------------------------------------- + ! Assume weighting based on how close middle of that layer is nearest the + ! highest water table estimate and apply to the current nzw layer and layer + ! above: + !--------------------------------------------------------------------------- + DO n=1,nshyd+1 + IF (n >= nzw-2 .AND. n <= nzw+1) THEN + wgt(n) = ABS(0.5*(zdepth(n-1)+zdepth(n))-zw_l_min) + wgt(n) = MAX(wgt(n),0.01) ! limit so that does not get zw stuck + wgt_tot=wgt_tot+wgt(n) + END IF + END DO + + dwgt_tot=0.0 + DO n=1,nshyd+1 + IF (n >= nzw-2 .AND. n <= nzw+1) THEN + dwgt_tot=dwgt_tot+(wgt_tot-wgt(n)) + zw(i) = zw(i) + (wgt_tot-wgt(n))*zw_l(i,n) + END IF + END DO + + IF (nzw == 1) THEN + zw(i) = zw_l(i,1) + ELSE + zw(i)=zw(i)/dwgt_tot + END IF + + !----------------------------------------------------------------------- + ! scheme is designed to stop the over-estimate of water table depth + ! due to root zone therefore ensure new scheme does not set a deeper + ! water table than it would do with full soil moisture column: + !----------------------------------------------------------------------- + IF (zw(i) > zw_l(i,1)) THEN + zw(i) = zw_l(i,1) + END IF + + IF (zw(i) > zw_max) THEN + zw(i) = zw_max + END IF + +END DO +!$OMP END PARALLEL DO + +IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_out,zhook_handle) +RETURN + +END SUBROUTINE calc_zw2 +END MODULE calc_zw2_mod +#endif + diff --git a/src/science/soil/soil_hyd_jls_mod.F90 b/src/science/soil/soil_hyd_jls_mod.F90 index a629eb0b..d43a7715 100644 --- a/src/science/soil/soil_hyd_jls_mod.F90 +++ b/src/science/soil/soil_hyd_jls_mod.F90 @@ -29,7 +29,7 @@ SUBROUTINE soil_hyd (npnts, nshyd, soil_pts, timestep, l_top, l_soil_sat_down, & USE gauss_mod, ONLY: gauss !Use in relevant variables -USE jules_hydrology_mod, ONLY: zw_max +USE jules_hydrology_mod, ONLY: zw_max, l_darcy_lsh_all USE water_constants_mod, ONLY: rho_water ! density of pure water (kg/m3) USE jules_soil_mod, ONLY: gamma_w, l_holdwater @@ -124,7 +124,8 @@ SUBROUTINE soil_hyd (npnts, nshyd, soil_pts, timestep, l_top, l_soil_sat_down, & gamcon, & ! Constant (s/mm). dw, & - dwzw + dwzw, & + dz_lsh LOGICAL :: & use_lims @@ -154,8 +155,10 @@ SUBROUTINE soil_hyd (npnts, nshyd, soil_pts, timestep, l_top, l_soil_sat_down, & ! The rate of change of the explicit flux with STHU1 (kg/m2/s). dwflux_dsthu2(npnts,nshyd), & ! The rate of change of the explicit flux with STHU2 (kg/m2/s). - smclu(npnts,nshyd) + smclu(npnts,nshyd), & ! Unfrozen soil moisture contents of each layer (kg/m2). + dwflux_dsthu2_tmp(npnts,nshyd+1) + ! The rate of change of the explicit flux with STHU2 (kg/m2/s). INTEGER(KIND=jpim), PARAMETER :: zhook_in = 0 INTEGER(KIND=jpim), PARAMETER :: zhook_out = 1 @@ -215,9 +218,18 @@ SUBROUTINE soil_hyd (npnts, nshyd, soil_pts, timestep, l_top, l_soil_sat_down, & ! If L_VG_SOIL is T then Van Genuchten formulation is used, otherwise ! Brooks & Corey using Cosby parameters is used. -CALL hyd_con_ic (npnts, soil_pts, soil_index, bexp(:,nshyd), & - ksz(:,nshyd), sthu(:,nshyd), & - w_flux(:,nshyd), dwflux_dsthu1(:,nshyd)) +IF (l_darcy_lsh_all) THEN + dz_lsh = zw_max-zdepth(nshyd) + CALL darcy_ic (npnts, soil_pts, dz(nshyd), dz_lsh, soil_index, & + bexp(:,nshyd-1:nshyd), & + ksz(:,nshyd), sathh(:,nshyd-1:nshyd), & + sthu(:,nshyd), sthzw(:), w_flux(:,nshyd), & + dwflux_dsthu1(:,nshyd), dwflux_dsthu2_tmp(:,nshyd)) +ELSE + CALL hyd_con_ic (npnts, soil_pts, soil_index, bexp(:,nshyd), & + ksz(:,nshyd), sthu(:,nshyd), & + w_flux(:,nshyd), dwflux_dsthu1(:,nshyd)) +END IF DO n = 2,nshyd CALL darcy_ic (npnts, soil_pts, dz(n-1), dz(n), soil_index, bexp(:,n-1:n), & diff --git a/src/science/soil/soil_hyd_wt_mod.F90 b/src/science/soil/soil_hyd_wt_mod.F90 index 01e29e6e..3c2ba765 100644 --- a/src/science/soil/soil_hyd_wt_mod.F90 +++ b/src/science/soil/soil_hyd_wt_mod.F90 @@ -29,9 +29,13 @@ SUBROUTINE soil_hyd_wt (npnts, nshyd, soil_pts, curr_soilt, nsoilt, & ! Use relevant subroutines USE calc_zw_mod, ONLY: calc_zw +USE calc_zw2_mod, ONLY: calc_zw2 USE jules_water_tracers_mod, ONLY: l_wtrac_jls +!Use in relevant variables +USE jules_hydrology_mod, ONLY: l_calc_zw2 + USE parkind1, ONLY: jprb, jpim USE yomhook, ONLY: lhook, dr_hook @@ -174,8 +178,13 @@ SUBROUTINE soil_hyd_wt (npnts, nshyd, soil_pts, curr_soilt, nsoilt, & sthzw(i) = smclzw(i) / smclsatzw(i) END DO - CALL calc_zw(npnts, nshyd, soil_pts, soil_index, & + IF (l_calc_zw2) THEN + CALL calc_zw2(npnts, nshyd, soil_pts, soil_index, & + bexp, sathh, smcl, smclzw, smclsat, smclsatzw, v_sat, zw) + ELSE + CALL calc_zw(npnts, nshyd, soil_pts, soil_index, & bexp, sathh, smcl, smclzw, smclsat, smclsatzw, v_sat, zw) + END IF IF (l_wtrac_jls) THEN ! Update water tracer deep layer soil moisture fraction diff --git a/src/science/vegetation/crop_mod.F90 b/src/science/vegetation/crop_mod.F90 index a6269985..c688ee62 100644 --- a/src/science/vegetation/crop_mod.F90 +++ b/src/science/vegetation/crop_mod.F90 @@ -58,6 +58,14 @@ SUBROUTINE crop(p_field, land_pts, land_index, a_step, & USE ancil_info, ONLY: nsurft, nsoilt +USE sow_mod, ONLY: sow + +USE emerge_mod, ONLY: emerge + +USE develop_mod, ONLY: develop + +USE partition_mod, ONLY: partition + IMPLICIT NONE !----------------------------------------------------------------------------- diff --git a/src/science/vegetation/develop.F90 b/src/science/vegetation/develop_mod.F90 similarity index 97% rename from src/science/vegetation/develop.F90 rename to src/science/vegetation/develop_mod.F90 index b1c8ce11..21f43960 100644 --- a/src/science/vegetation/develop.F90 +++ b/src/science/vegetation/develop_mod.F90 @@ -4,6 +4,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT******************************* +MODULE develop_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE develop(n, t_surft, phot, tt_veg, tt_rep, dvi) @@ -92,3 +97,4 @@ SUBROUTINE develop(n, t_surft, phot, tt_veg, tt_rep, dvi) END IF END SUBROUTINE develop +END MODULE develop_mod diff --git a/src/science/vegetation/emerge.F90 b/src/science/vegetation/emerge_mod.F90 similarity index 96% rename from src/science/vegetation/emerge.F90 rename to src/science/vegetation/emerge_mod.F90 index c4e3617c..d74f70b9 100644 --- a/src/science/vegetation/emerge.F90 +++ b/src/science/vegetation/emerge_mod.F90 @@ -4,6 +4,12 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT******************************* +MODULE emerge_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE emerge(n, t_surft, dvi) USE conversions_mod, ONLY: rsec_per_day @@ -58,3 +64,4 @@ SUBROUTINE emerge(n, t_surft, dvi) dvi = dvi + ( teff / tt_emr(n) ) END SUBROUTINE emerge +END MODULE emerge_mod diff --git a/src/science/vegetation/partition.F90 b/src/science/vegetation/partition_mod.F90 similarity index 98% rename from src/science/vegetation/partition.F90 rename to src/science/vegetation/partition_mod.F90 index b543097c..a73d55aa 100644 --- a/src/science/vegetation/partition.F90 +++ b/src/science/vegetation/partition_mod.F90 @@ -4,6 +4,11 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT******************************* +MODULE partition_mod + +IMPLICIT NONE + +CONTAINS SUBROUTINE partition(n, npp_ft_acc, dvi, rootc, harvc, reservec, & nonyield_diag, stemc, leafc, harv_count, harv_trig) @@ -155,3 +160,4 @@ SUBROUTINE partition(n, npp_ft_acc, dvi, rootc, harvc, reservec, & END SUBROUTINE partition +END MODULE partition_mod diff --git a/src/science/vegetation/sow.F90 b/src/science/vegetation/sow_mod.F90 similarity index 98% rename from src/science/vegetation/sow.F90 rename to src/science/vegetation/sow_mod.F90 index b7c7b998..9964ba6d 100644 --- a/src/science/vegetation/sow.F90 +++ b/src/science/vegetation/sow_mod.F90 @@ -4,6 +4,12 @@ ! which you should have received as part of this distribution. ! *****************************COPYRIGHT******************************* +MODULE sow_mod + +IMPLICIT NONE + +CONTAINS + SUBROUTINE sow(n, sm_levels, t_soil, sthu, smvcst, smvccl, dphotdt, & sowdate, dvi) @@ -98,3 +104,4 @@ SUBROUTINE sow(n, sm_levels, t_soil, sthu, smvcst, smvccl, dphotdt, & END IF END SUBROUTINE sow +END MODULE sow_mod diff --git a/src/util/logging_mod.F90 b/src/util/logging_mod.F90 index eb1d0d06..c6046412 100644 --- a/src/util/logging_mod.F90 +++ b/src/util/logging_mod.F90 @@ -10,7 +10,7 @@ MODULE logging_mod USE jules_vars_mod, ONLY: mpi_local_comm -USE ISO_FORTRAN_ENV, ONLY: OUTPUT_UNIT, ERROR_UNIT +USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY: OUTPUT_UNIT, ERROR_UNIT IMPLICIT NONE