Skip to content

Commit

Permalink
Ruisdael: rebase open boundary conditions onto v4.4.1
Browse files Browse the repository at this point in the history
Open boundary conditions by Frans Liqui Lung
Poisson solver with FFTW and OpenBC from CaNS by Pedro Simões Costa
Merged and updated for mixed precision by Fredrik Jansson

Squashed commit of the following:

commit 9f10ba2
Merge: bec7d8c cc84edf
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Wed Dec 14 15:52:02 2022 +0100

    Merge remote-tracking branch 'frans/ruisdael' into ruisdael

commit bec7d8c
Merge: 8d64687 a77d2e7
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Tue Dec 13 17:17:00 2022 +0100

    Merge branch 'ruisdael_exner' into ruisdael

commit cc84edf
Author: Frans Liqui Lung <frans.liquilung@gmail.com>
Date:   Tue Dec 13 11:44:49 2022 +1100

    removed old code to allow for different initial pressure solver

commit 41edb30
Author: Frans Liqui Lung <frans.liquilung@gmail.com>
Date:   Tue Dec 13 11:36:33 2022 +1100

    adjusted initial convergence correction to be compatible with cosine fourier solver, implemented in modstartup to avoid cross dependency conflict between modpois and modopenboundaries

commit 09498f6
Author: Frans Liqui Lung <nmfl@aa6-100.bullx>
Date:   Sun Oct 2 20:26:12 2022 +0000

    removed print from modsynturb and removed hard set top layer of temperature in modboundary

commit 031b97b
Author: Frans Liqui Lung <nmfl@ac6-103.bullx>
Date:   Thu Sep 15 10:29:21 2022 +0000

    fixed timing issue in modsynturb

commit 8d64687
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Thu Nov 17 14:43:12 2022 +0100

    Open boundary conditions and FFTW

    FFTW can be used also with open lateral boundary conditions.
    Pressure solver boundary condition is Neumann on the open boundaries.
    The following modifications are made for the direction(s) with open boundaries:
    * use Discrete Cosine Transform instead of FFT.
      - FFTW_REDFT_10 forward
      - FFTW_REDFT_01 back
    * normalization constant is different, a factor 2 per direction
    * the eigenvalues xrt, yrt are different

    By Pedro Simões Costa and Fredrik Jansson

commit a77d2e7
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Fri Sep 16 15:07:13 2022 +0200

    allow multiple planes for crossxz, crossyz and in any MPI tile

commit 98dbc56
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Tue Mar 2 11:22:12 2021 +0100

    Added option to disable certain cross-sections (xy, xz, yz)

commit 22174b0
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Fri Sep 16 09:37:54 2022 +0200

    add PHYSICS/lconstexner flag, output exnf, exnh to profiles.nc

commit 854ca46
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Thu Sep 15 14:44:10 2022 +0200

    try using the initial pressure profile in the exner function

commit 0fd18d2
Merge: f2fe301 41bd220
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Mon Aug 8 15:51:58 2022 +0200

    Merge pull request #77 from natalieth/patch-1

    rename randomNumbers

commit f2fe301
Merge: 4b76227 8784487
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Mon Aug 8 15:51:29 2022 +0200

    Merge pull request #76 from natalieth/patch-2

    remove comma (typo)

commit 8784487
Author: Natalie Theeuwes <19662980+natalieth@users.noreply.github.com>
Date:   Mon Aug 8 15:25:22 2022 +0200

    remove comma (typo)

commit 41bd220
Author: Natalie Theeuwes <19662980+natalieth@users.noreply.github.com>
Date:   Mon Aug 8 15:23:19 2022 +0200

    rename randomNumbers

commit 4b76227
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Wed Apr 6 20:15:07 2022 +0200

    hypre: switch PFMG-preconditioner to use red-black smoother, faster

commit bf32003
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Mon Apr 4 18:33:38 2022 +0200

    add SOLVER namelist variable hypre_logging for setting hypre printing amount

commit 2db7993
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Mon Apr 4 18:32:33 2022 +0200

    add alternative name for hypre library for Ubuntu

commit 94f360a
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Sat Apr 2 09:11:15 2022 +0200

    hypre singularity-fix: fix off-by-one, move anchor point cose to top of domain

commit 729ce43
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Fri Apr 1 16:35:02 2022 +0200

    print wall time of poisson solver, try without modifying neighbors of the special element, zero guess in RK step 1

commit 2f59d56
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Tue Mar 29 21:28:30 2022 +0200

    iterative solver: try making the matrix non-singular for better convergence

commit 28717a2
Author: Frans Liqui Lung <frans.liquilung@gmail.com>
Date:   Mon Mar 7 15:34:02 2022 +1100

    added flag for compatibility periodic simulations

commit 371ec7e
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Mon Feb 14 18:25:38 2022 +0100

    hypre: update dummy routine in modnohypre to have same parameters as real routine

commit 4b186a0
Author: Frans Liqui Lung <f.p.a.liquilung-1@tudelft.nl>
Date:   Fri Jan 28 15:40:14 2022 +1100

    finalised extra hypre input for preconditioner

commit 9401ce6
Author: Frans Liqui Lung <f.p.a.liquilung-1@tudelft.nl>
Date:   Tue Jan 11 16:43:16 2022 +1100

    disconnected iterations preconditionar from max iterations total of pressure solver (HYPRE)

commit 7247c00
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Mon Dec 20 17:09:06 2021 +0100

    fixed mistake in initial divergence correction

commit e9c5dd8
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Mon Dec 20 14:11:34 2021 +0100

    added divergence correction for initial field when a heterogneous initialisation is used

commit 55e7fe4
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Mon Dec 20 13:18:01 2021 +0100

    Changed hypre coding to take solver as an input to the hypre subroutines, such that multiple solvers can be created and coexist. This is a preparation to be able to use a different solver to remove any divergence from a heterogneous starting field. Doesn't change anything to the performance/results of the solvers.

commit 3b4aade
Merge: a4289f0 3f42824
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Mon Feb 14 18:47:40 2022 +0100

    Merge commit '3f428245ff' into ruisdael

commit 3f42824
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Wed Dec 8 11:48:44 2021 +0100

    fixed rhointi bug found in modopenboundary during tests

commit 1ae6709
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Wed Dec 8 09:52:33 2021 +0100

    Adjusted program for openboundaries

commit 73e4926
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Wed Dec 8 09:37:57 2021 +0100

    fixed bugs found in modstartup during compilation

commit e864a04
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Wed Dec 8 09:32:28 2021 +0100

    fixed bugs found in advection during compilation

commit c9c9a10
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Wed Dec 8 09:23:13 2021 +0100

    Adjusted modmpi for openboundaries

commit 4d9fe7f
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Wed Dec 8 09:20:24 2021 +0100

    fixed bugs found in modopenboundary during compilation

commit 8242f56
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Wed Dec 8 09:09:56 2021 +0100

    Adjusted modlsm for openboundaries

commit 78de429
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Wed Dec 8 09:04:31 2021 +0100

    Adjusted modsurface for openboundaries

commit c7a8aae
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Wed Dec 8 08:46:29 2021 +0100

    Adjusted modstartup for openboundaries

commit 356c2af
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Tue Dec 7 16:46:56 2021 +0100

    Adjusted modglobal for openboundaries

commit b721669
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Tue Dec 7 16:32:08 2021 +0100

    Adjusted modpois for openboundaries

commit 5b6810b
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Tue Dec 7 16:25:55 2021 +0100

    Adjusted modgenstat for openboundaries, covariances take non-zero w profile into account

commit 2151204
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Tue Dec 7 16:18:28 2021 +0100

    Adjusted modforces for openboundaries

commit 24db68a
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Tue Dec 7 16:16:47 2021 +0100

    Adjusted modsubgrid for openboundaries

commit d250ed8
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Tue Dec 7 16:14:36 2021 +0100

    Adjusted advection for openboundaries

commit e174ff4
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Tue Dec 7 16:04:57 2021 +0100

    Adjusted advec_2nd for openboundaries

commit dc2300d
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Tue Dec 7 15:40:53 2021 +0100

    Adjusted modhypre for openboundaries

commit 6d9b23a
Author: Frans Liqui Lung <franslql@hotmail.com>
Date:   Tue Dec 7 15:35:30 2021 +0100

    Added modopenboundary.f90 and modsynturb.f90

commit a4289f0
Author: Bart van Stratum <bart@vanstratum.com>
Date:   Wed Sep 8 14:54:23 2021 +0200

    Added CO2 scalar for A-Gs net assimilation, for offline budget checks

commit 02372b5
Author: Bart van Stratum <bart@vanstratum.com>
Date:   Tue Sep 7 09:43:17 2021 +0200

    Added A-Gs option without emission module

commit 8c7881f
Author: Bart van Stratum <bart@vanstratum.com>
Date:   Tue Sep 7 08:08:14 2021 +0200

    Added CO2 respiration/assimilation to cross-section and time series.

commit 4dc4a0b
Author: Bart van Stratum <bart@vanstratum.com>
Date:   Mon Sep 6 16:36:23 2021 +0200

    Added A-Gs to the new land surface model

commit 3050704
Author: Bart van Stratum <bart@vanstratum.com>
Date:   Mon Sep 6 12:05:31 2021 +0200

    Added basic infrastructure for A-Gs and communication with emission module

commit bdfa25e
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Tue Jun 8 16:56:12 2021 +0200

    AG-s <-> emission interface indicators now relative to full list of scalar fields

commit 0424c3c
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Tue Jun 8 15:53:49 2021 +0200

    Emission <-> AGS interface

commit c05eee0
Merge: d329736 002a862
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Mon Nov 9 12:13:43 2020 +0100

    Merge branch 'ruisdael_lsm' into ruisdael

commit 002a862
Author: Bart van Stratum <bart@vanstratum.com>
Date:   Fri Nov 6 11:30:33 2020 +0100

    Calculate obukhov length from tile averaged fluxes, instead of
    calculating a tiled mean

commit 01a48d8
Author: Bart van Stratum <bart@vanstratum.com>
Date:   Tue Nov 3 09:12:35 2020 +0100

    Bugfix harmonic mean calculation (which is currently not used in the
    code..)

commit d329736
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Tue Oct 27 11:25:58 2020 +0100

    update fix for #58 - allow lsmcrossection also for new LSM isurf=11

commit 8b42f82
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Fri Oct 23 11:03:29 2020 +0200

    emission: remove MPI-parallel .nc read, add better namelist error reporting

commit fa1a4b5
Merge: 15a81a3 8230865
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Fri Oct 16 15:42:00 2020 +0200

    Merge branch 'ruisdael_lsm' into ruisdael

commit 8230865
Author: Bart van Stratum <bart@vanstratum.com>
Date:   Fri Oct 16 10:18:03 2020 +0200

    Added NetCDF file with van Genuchten parameters

commit 15a81a3
Merge: 6eddb8f 58f9d33
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Thu Oct 15 14:57:17 2020 +0200

    Merge branch 'to4.3_Fredrik' into ruisdael

commit 58f9d33
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Thu Oct 15 14:56:53 2020 +0200

    advec_kappa : remove debug write()

commit 6eddb8f
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Thu Oct 15 14:43:57 2020 +0200

    modnudgebounday: use random_number() instead of rand() for better intel/gnu compatibility

commit b70f80e
Merge: 796eaae 6b4a3ab
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Thu Oct 15 14:04:57 2020 +0200

    Merge branch '4.2_emission' into ruisdael

commit 6b4a3ab
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Thu Oct 15 13:43:10 2020 +0200

    Renaming of emission related variables

commit 6b199b3
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Mon Oct 12 17:01:12 2020 +0200

    advec_kappa: do advection only for the k-range with non-zero input field

commit 85b2be8
Author: Jisk Attema <j.attema@esciencecenter.nl>
Date:   Thu Oct 1 13:57:37 2020 +0200

    Add intent to slabsum arguments

commit 5887bd0
Author: Jisk Attema <j.attema@esciencecenter.nl>
Date:   Tue Sep 29 15:13:12 2020 +0200

    gfortran switches

    when using default-real-8, constants and variables explicitly declared
    as double will become quadruples, which we dont want for DALES.
    quadruple precision could even result in software fallback, which is much
    slower.
    Adding the default-double-8 keeps doubles at double precision.

    Aliging stuff on 64-bit boundaries could help a bit with vectorization.

    Not initializing variables will speed things up when using large arrays

commit 7ebd462
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Wed Oct 7 18:59:33 2020 +0200

    fix error in previous fix of #48 - used wrong time array in ls forcing

commit e295c35
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Tue Oct 6 10:01:40 2020 +0200

    Update benchmark cases to use the standard kappa scheme 7 instead of the removed experimental one

commit d088437
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Tue Oct 6 09:56:14 2020 +0200

    Remove experimental kappa scheme iadv=77
    which is now redundant. The non-uniform grid support has been
    merged into the main kappa scheme.

commit 20b27f8
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Tue Oct 6 09:45:00 2020 +0200

    Optimized advec_kappa scheme
    - rlim function inlined and rewritten without division and eps1
    - both branches of if uvw0 > 0 calculated, then selected
      in order to enable vectorization.
    by Jisk Attema and Fredrik Jansson

commit d307f11
Merge: a73ad93 7f86be4
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Tue Sep 22 10:53:16 2020 +0200

    Merge to4.3 into 4.2_emission

commit a73ad93
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Tue Sep 22 10:43:18 2020 +0200

    Included all scalar fields in crosssection output (similar to fielddump)

commit 78e6594
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Tue Sep 15 15:13:54 2020 +0200

    Improved bookkeeping of scalar field numbers and names

commit 7f23960
Merge: 038d2b6 c2db0ee
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Sep 7 11:05:02 2020 +0200

    Merge branch 'to4.3_lsm' into ruisdael_lsm

commit c2db0ee
Merge: 704d145 7f86be4
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Sep 7 11:02:57 2020 +0200

    Merge remote-tracking branch 'upstream/to4.3' into to4.3_lsm

commit 704d145
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Sep 7 10:31:11 2020 +0200

    Small fix in calculation liq. water fraction, plus added cleanup of
    arrays

commit c1eb5a4
Author: julietbravo <bart@vanstratum.com>
Date:   Fri Sep 4 15:02:36 2020 +0200

    Fixed dynamic tile fraction for cases with open water

commit 4aec697
Author: julietbravo <bart@vanstratum.com>
Date:   Fri Sep 4 11:33:18 2020 +0200

    Added water tile to time series statistics

commit 13e4129
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Tue Sep 1 15:05:35 2020 +0200

    Removed temporary forcing at lateral boundaries

commit 36730a8
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Tue Sep 1 15:02:30 2020 +0200

    Added boundary nudging of scalar fields

commit 0069bf4
Author: julietbravo <bart@vanstratum.com>
Date:   Thu Jul 30 15:43:29 2020 +0200

    Added additional variables to surface cross-sections

commit 6637916
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jul 21 14:12:40 2020 +0200

    Modified modlsmcrosssection for new LSM

commit 45c6b5e
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jul 21 12:45:14 2020 +0200

    Store/load the water tiles for restarts (results = bitwise identical
    now)

commit 5925ee2
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jul 21 09:19:12 2020 +0200

    Fixed some MPI issues in new LSM

commit 3f8c6ac
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jul 20 11:55:18 2020 +0200

    First ~working version with water tile (still has some issues...)

commit e4c0755
Merge: a6ca5f1 f470b41
Author: julietbravo <bart@vanstratum.com>
Date:   Fri Jul 17 15:39:12 2020 +0200

    Merge remote-tracking branch 'upstream/to4.3' into to4.3_lsm_water

commit a6ca5f1
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jul 7 17:28:34 2020 +0200

    Added option to read the spatial data for heterogeneous land surfaces

commit b624922
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jul 7 11:53:21 2020 +0200

    Added restart functionality to new LSM

commit cfc205e
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jul 7 11:00:32 2020 +0200

    Added old soil grid definition, different soil interpolation types, plus
    fixed bug in buoyancy calculation

commit a2e51fb
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jul 6 16:29:59 2020 +0200

    Added calculation of liquid water reservoir (plus bugfix ra
    calculation)

commit 491b393
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jul 6 12:21:21 2020 +0200

    Added root water extraction to soil water budget

commit 4891bb5
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jul 6 11:23:16 2020 +0200

    Added bulk (grid point mean) quantities needed for SGS model

commit 027b03b
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jul 6 09:01:42 2020 +0200

    Added calculation of bulk (grid point mean) scalar BCs

commit a0d4cbf
Author: julietbravo <bart@vanstratum.com>
Date:   Fri Jul 3 18:02:56 2020 +0200

    Working surface solver, with fluxes per tile

commit 12dd3e3
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Fri Jul 3 14:13:06 2020 +0200

    3D emission and namelist options; emission switch (l_emission) and vertical upper limit to apply emission (kemis)

commit 3184f6b
Author: julietbravo <bart@vanstratum.com>
Date:   Thu Jul 2 16:32:56 2020 +0200

    Bugfix calculation canopy resistances

commit 656839f
Author: julietbravo <bart@vanstratum.com>
Date:   Thu Jul 2 16:30:10 2020 +0200

    Added calculation canopy and soil resistance

commit c56c478
Author: julietbravo <bart@vanstratum.com>
Date:   Thu Jul 2 12:13:05 2020 +0200

    Working tiled surface layer solver

commit 8def726
Author: julietbravo <bart@vanstratum.com>
Date:   Wed Jul 1 16:25:10 2020 +0200

    Start of tiled surface layer solver

commit 2b3e826
Author: julietbravo <bart@vanstratum.com>
Date:   Wed Jul 1 10:00:08 2020 +0200

    Added calculation hydraulic properties (van Genuchten) and diffusion solver for
    soil moisture

commit f215e66
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jun 30 16:51:10 2020 +0200

    Added calculation of soil thermal properties, and (explicit) temperature
    diffusion solver

commit 61de721
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jun 30 14:39:31 2020 +0200

    Added calculation derived van Genuchten parameters

commit 3261422
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jun 30 11:38:47 2020 +0200

    Added minimal set of time series statistics for the new LSM

commit 6b5d8be
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jun 30 11:08:45 2020 +0200

    Modified modlsmstat to work with the new LSM

commit 6939641
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jun 30 09:52:26 2020 +0200

    Minor changes new LSM

commit 7818aeb
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Mon Jun 29 16:49:25 2020 +0200

    Typo in modemisdata.f90

commit 0772796
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Mon Jun 29 16:13:57 2020 +0200

    Corrected emission scalar list to work with microphysics, i.e. skip first 2 scalar fields

commit 1d141d4
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Mon Jun 29 16:12:01 2020 +0200

    Fixed incorrect NORTH/EAST boundary indices

commit b7dd889
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jun 29 15:45:35 2020 +0200

    Added soil grid and initialisation of soil

commit 9e78c3d
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jun 29 13:52:11 2020 +0200

    Added homogeneous initialisation of LSM

commit db40554
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jun 29 12:23:47 2020 +0200

    Added data structures for land-surface tiles

commit 796eaae
Merge: 7860bb9 e5da4f8
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Thu Jun 25 12:01:06 2020 +0200

    Merge remote-tracking branch 'origin/4.2_emission' into ruisdael
    Merge surface emission map code by M de Bruine

commit 7860bb9
Merge: 038d2b6 f0fb85d
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Thu Jun 25 11:58:33 2020 +0200

    Merge branch 'to4.3' into ruisdael
    merging for gfortran 10 compatibility

commit e5da4f8
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Thu Jun 25 11:27:58 2020 +0200

    Add file moddatetime for reading emission files.

commit 5e47c93
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jun 15 12:06:48 2020 +0200

    Start at implemention realistic LSM

commit 5cf1aff
Merge: c6c8324 038d2b6
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Mon Jun 8 11:30:33 2020 +0200

    Merge with ruisdael branch

commit c6c8324
Merge: 1407034 9278ce3
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Fri Jun 5 16:10:02 2020 +0200

    Merge with master

commit 1407034
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Fri Jun 5 15:17:20 2020 +0200

    Added scaling for model resolution and domain dboundary 'nullifier'

commit 038d2b6
Merge: 89b4830 1cc8a3c
Author: Fredrik Jansson <jansson@cwi.nl>
Date:   Wed Jun 3 16:20:56 2020 +0200

    Merge branch 'to4.3' into ruisdael
    for PR #53 - Only set `tauField` when A-gs is enabled

commit baeab65
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Tue Apr 28 10:38:29 2020 +0200

    Changes in documentation and compiler settings

commit 89b4830
Author: Fredrik Jansson <jansson@cwi.nl>
Date:   Tue Apr 14 15:43:41 2020 +0200

    boundary nudging: add check for tile size being sufficient to contain the nudging domain

commit 8cd006c
Author: Fredrik Jansson <jansson@cwi.nl>
Date:   Fri Apr 10 14:56:32 2020 +0200

    Print warning when unspecified iadv_sv values are set to iadv_mom

commit 6e208f5
Author: Fredrik Jansson <jansson@cwi.nl>
Date:   Tue Apr 7 13:11:48 2020 +0200

    Add boundary nudging by BvS

commit e61fddc
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Thu Feb 27 15:03:53 2020 +0100

    Realistic surface emissions (WIP)

commit 4b9dec3
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Mon Dec 9 15:37:52 2019 +0100

    New emission routines: Reading (parallel netCDF) of 2D surface emission on native grid
  • Loading branch information
fjansson committed Jun 7, 2023
1 parent efd47cb commit 7cf51b4
Show file tree
Hide file tree
Showing 18 changed files with 3,065 additions and 447 deletions.
31 changes: 16 additions & 15 deletions src/advec_2nd.f90
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ subroutine advecc_2nd(a_in,a_out)
end do

do j=2,j1
do k=2,kmax
do k=2,kmax
do i=2,i1
a_out(i,j,k) = a_out(i,j,k)- (1./rhobf(k))*( &
w0(i,j,k+1) * (rhobf(k+1) * a_in(i,j,k+1) + rhobf(k) * a_in(i,j,k)) &
Expand Down Expand Up @@ -118,12 +118,12 @@ end subroutine advecc_2nd


!> Advection at the u point.
subroutine advecu_2nd(a_in, a_out)

subroutine advecu_2nd(a_in, a_out, sx)
use modglobal, only : i1,ih,j1,jh,k1,kmax,dxiq,dyiq,dziq,dzf,dzh,leq
use modfields, only : u0, v0, w0, rhobf
implicit none

integer, intent(in) :: sx
real(field_r), dimension(2-ih:i1+ih,2-jh:j1+jh,k1), intent(in) :: a_in
real(field_r), dimension(2-ih:i1+ih,2-jh:j1+jh,k1), intent(inout) :: a_out
! real, dimension(2-ih:i1+ih,2-jh:j1+jh,k1) :: rho_a_in
Expand All @@ -144,7 +144,7 @@ subroutine advecu_2nd(a_in, a_out)
do j=2,j1
jm=j-1
jp=j+1
do i=2,i1
do i=sx,i1
im=i-1
ip=i+1
a_out(i,j,k) = a_out(i,j,k)- ( &
Expand All @@ -166,7 +166,7 @@ subroutine advecu_2nd(a_in, a_out)
do j=2,j1
jm=j-1
jp=j+1
do i=2,i1
do i=sx,i1
im=i-1
ip=i+1
a_out(i,j,1) = a_out(i,j,1)-(1./rhobf(1))*( &
Expand All @@ -181,7 +181,7 @@ subroutine advecu_2nd(a_in, a_out)
do k=2,kmax
km=k-1
kp=k+1
do i=2,i1
do i=sx,i1
im=i-1
ip=i+1
a_out(i,j,k) = a_out(i,j,k)- (1./rhobf(k))*( &
Expand All @@ -197,7 +197,7 @@ subroutine advecu_2nd(a_in, a_out)
do j=2,j1
jm=j-1
jp=j+1
do i=2,i1
do i=sx,i1
im=i-1
ip=i+1
a_out(i,j,1) = a_out(i,j,1)- (1./rhobf(1))*( &
Expand All @@ -212,7 +212,7 @@ subroutine advecu_2nd(a_in, a_out)
do k=2,kmax
km=k-1
kp=k+1
do i=2,i1
do i=sx,i1
im=i-1
ip=i+1
a_out(i,j,k) = a_out(i,j,k)- (1./rhobf(k))*( &
Expand All @@ -234,12 +234,13 @@ end subroutine advecu_2nd


!> Advection at the v point.
subroutine advecv_2nd(a_in, a_out)

subroutine advecv_2nd(a_in, a_out, sy)
use modglobal, only : i1,ih,j1,jh,k1,kmax,dxiq,dyiq,dziq,dzf,dzh,leq
use modfields, only : u0, v0, w0, rhobf
implicit none


integer,intent(in) :: sy
real(field_r), dimension(2-ih:i1+ih,2-jh:j1+jh,k1), intent(in) :: a_in !< Input: the v-field
real(field_r), dimension(2-ih:i1+ih,2-jh:j1+jh,k1), intent(inout) :: a_out !< Output: the tendency
! real, dimension(2-ih:i1+ih,2-jh:j1+jh,k1) :: rho_a_in
Expand All @@ -257,7 +258,7 @@ subroutine advecv_2nd(a_in, a_out)
do k=1,kmax
km=k-1
kp=k+1
do j=2,j1
do j=sy,j1
jm=j-1
jp=j+1
do i=2,i1
Expand All @@ -279,7 +280,7 @@ subroutine advecv_2nd(a_in, a_out)

if (leq) then

do j=2,j1
do j=sy,j1
jm=j-1
jp=j+1
do i=2,i1
Expand All @@ -291,7 +292,7 @@ subroutine advecv_2nd(a_in, a_out)
end do
end do

do j=2,j1
do j=sy,j1
jm=j-1
jp=j+1
do k=2,kmax
Expand All @@ -309,7 +310,7 @@ subroutine advecv_2nd(a_in, a_out)
end do

else
do j=2,j1
do j=sy,j1
jm=j-1
jp=j+1
do i=2,i1
Expand All @@ -322,7 +323,7 @@ subroutine advecv_2nd(a_in, a_out)
end do
end do

do j=2,j1
do j=sy,j1
jm=j-1
jp=j+1
do k=2,kmax
Expand Down
31 changes: 19 additions & 12 deletions src/modadvection.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ module modadvection
subroutine advection

use modglobal, only : lmoist, nsv, iadv_mom,iadv_tke,iadv_thl,iadv_qt,iadv_sv, &
iadv_cd2,iadv_5th,iadv_52,iadv_cd6,iadv_62,iadv_kappa,iadv_upw,iadv_hybrid,iadv_hybrid_f,iadv_null,leq
iadv_cd2,iadv_5th,iadv_52,iadv_cd6,iadv_62,iadv_kappa,&
iadv_upw,iadv_hybrid,iadv_hybrid_f,iadv_null,leq,&
lopenbc,lboundary,lperiodic
use modfields, only : u0,up,v0,vp,w0,wp,e120,e12p,thl0,thlp,qt0,qtp,sv0,svp
use modsubgrid, only : lsmagorinsky
use advec_2nd, only : advecu_2nd, advecv_2nd, advecw_2nd, advecc_2nd
Expand All @@ -43,15 +45,20 @@ subroutine advection
use advec_kappa, only : advecc_kappa
use advec_upw, only : advecc_upw
implicit none
integer :: n
integer :: n,sx = 2,sy = 2

! leq = .false. ! for testing that the non-uniform advection routines agree with the uniform ones
! when the grid is uniform


if(lopenbc) then ! Calculate tendencies only for non-domain boundary cells if openboundaries are used
if(lboundary(1).and. .not. lperiodic(1)) sx = 3
if(lboundary(3).and. .not. lperiodic(3)) sy = 3
endif

select case(iadv_mom)
case(iadv_cd2)
call advecu_2nd(u0,up)
call advecv_2nd(v0,vp)
call advecu_2nd(u0,up,sx)
call advecv_2nd(v0,vp,sy)
call advecw_2nd(w0,wp)
case(iadv_5th)
!if (.not. leq) stop "advec_5th does not support a non-uniform vertical grid."
Expand Down Expand Up @@ -82,7 +89,7 @@ subroutine advection
call advecv_5th(v0,vp)
call advecw_5th(w0,wp)
case(iadv_null)
! null advection scheme
! null advection scheme
stop "Null advection scheme selected for iadv_mom - probably a bad idea."
case default
stop "Unknown advection scheme "
Expand All @@ -109,9 +116,9 @@ subroutine advection
call advecc_hybrid(e120,e12p)
case(iadv_hybrid_f)
!if (.not. leq) stop "advec_hybrid_f does not support a non-uniform vertical grid."
call advecc_hybrid_f(e120,e12p)
call advecc_hybrid_f(e120,e12p)
case(iadv_null)
! null advection scheme
! null advection scheme
stop "Null advection scheme selected for iadv_tke - probably a bad idea."
case default
stop "Unknown advection scheme "
Expand Down Expand Up @@ -143,8 +150,8 @@ subroutine advection
!if (.not. leq) stop "advec_hybrid_f does not support a non-uniform vertical grid."
call advecc_hybrid_f(thl0,thlp,1.0)
case(iadv_null)
! null advection scheme
stop "Null advection scheme selected for iadv_thl - probably a bad idea."
! null advection scheme
stop "Null advection scheme selected for iadv_thl - probably a bad idea."
case default
stop "Unknown advection scheme "
end select
Expand Down Expand Up @@ -174,7 +181,7 @@ subroutine advection
!if (.not. leq) stop "advec_hybrid_f does not support a non-uniform vertical grid."
call advecc_hybrid_f(qt0,qtp,1e-3)
case(iadv_null)
! null advection scheme
! null advection scheme
stop "Null advection scheme selected for iadv_qt - probably a bad idea."
case default
stop "Unknown advection scheme "
Expand Down Expand Up @@ -204,7 +211,7 @@ subroutine advection
call advecc_hybrid(sv0(:,:,:,n),svp(:,:,:,n))
case(iadv_hybrid_f)
!if (.not. leq) stop "advec_hybrid_f does not support a non-uniform vertical grid."
call advecc_hybrid_f(sv0(:,:,:,n),svp(:,:,:,n))
call advecc_hybrid_f(sv0(:,:,:,n),svp(:,:,:,n))
case(iadv_null)
! null advection scheme - do nothing
case default
Expand Down
15 changes: 8 additions & 7 deletions src/modboundary.f90
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ end subroutine cyclicm
!! to infinity at the bottom of the sponge layer.
!! \endlatexonly
subroutine grwdamp
use modglobal, only : i1,j1,kmax,cu,cv,lcoriol,igrw_damp,geodamptime,nsv,rdt,unudge,dzf
use modglobal, only : i1,j1,kmax,cu,cv,lcoriol,igrw_damp,geodamptime,nsv,rdt,unudge,dzf,lopenbc
use modfields, only : up,vp,wp,thlp,qtp,u0,v0,w0,thl0,qt0,sv0,ug,vg &
,thl0av,qt0av,sv0av,u0av,v0av
implicit none
Expand Down Expand Up @@ -189,12 +189,13 @@ subroutine grwdamp
! Additional to gravity wave damping, set qt, thl and sv0(:) equal to slabaverage
! at level kmax.
! Originally done in subroutine tqaver, now using averages from modthermodynamics

thl0(2:i1,2:j1,kmax) = thl0av(kmax)
qt0 (2:i1,2:j1,kmax) = qt0av(kmax)
do n=1,nsv
sv0(2:i1,2:j1,kmax,n) = sv0av(kmax,n)
end do
if(.not.lopenbc) then
thl0(2:i1,2:j1,kmax) = thl0av(kmax)
qt0 (2:i1,2:j1,kmax) = qt0av(kmax)
do n=1,nsv
sv0(2:i1,2:j1,kmax,n) = sv0av(kmax,n)
end do
endif

return
end subroutine grwdamp
Expand Down
9 changes: 4 additions & 5 deletions src/modchecksim.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ module modchecksim

implicit none
private
public initchecksim,checksim
public initchecksim,checksim,chkdiv

real :: tcheck = 0.
integer(kind=longint) :: tnext = 3600.,itcheck
real :: dtmn =0.,ndt =0.

! explanations for dt_limit, determined in tstep_update()
character (len=15) :: dt_reasons(0:5) = [character(len=15):: "initial step", "timee", "dt_lim" , "idtmax", "velocity", "diffusion"]

save
contains
!> Initializing Checksim. Read out the namelist, initializing the variables
Expand Down Expand Up @@ -200,9 +200,8 @@ subroutine chkdiv
write(6 ,'(A,2ES11.2,A,A)')'divmax, divtot = ', divmax, divtot, ' dt limited by ', dt_reasons(dt_reason)
end if

return
return

end subroutine chkdiv

end module modchecksim

Loading

0 comments on commit 7cf51b4

Please sign in to comment.