Skip to content

Commit

Permalink
Ruisdael: rebase emission and new land surface model onto v4.4.1.
Browse files Browse the repository at this point in the history
Land surface model by Bart van Stratum
Emission model by Marco de Bruine
Merged and updated for mixed precision by Fredrik Jansson

The land surface model allows reading in a map of land surface properties.
The emission model allows reading in a map of scalar emission sources.

Squashed commit of the following:

commit 44b5a584861593a63d94c2fea79fc4195dd71e67
Author: Fredrik Jansson <fjansson@abo.fi>
Date:   Mon Jun 5 12:07:44 2023 +0200

    rebasing Ruisdael emission and LSM on 4.4.1. Fixes for mixed precision.

commit d9f0dba64e9e35080cfe8cdf5502380e50442ee9
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 378607e40dc127394584b25510abb131f7b62b32
Author: Bart van Stratum <bart@vanstratum.com>
Date:   Tue Sep 7 09:43:17 2021 +0200

    Added A-Gs option without emission module

commit ec0a375c4f562c7b279efb9e3a83d04b4a483047
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 1e3a000292e5067301fee3f578407f0befdcaaa8
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 1e64628ba65679857a82c11c5b8d40fa819bcd6b
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 170eb9f7c182baf436a8ce31568c0922392d1b44
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 280e180082b7a02a0cfa0e7c331a0ca19092e307
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Tue Jun 8 15:53:49 2021 +0200

    Emission <-> AGS interface

commit c1ed132ea2eb221550d37ae7efdb22901a9aef56
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 314b3f30b3d874f363e65f86ab80e927b1324bc5
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 b852be87c837978c8f1c9443d331d19bcdcb8153
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 ca74c6d8d42a968e413ace9b567f8468698a2f44
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 b2e1b2c0de9b90d81911e42c188048bb443fc0ce
Author: Bart van Stratum <bart@vanstratum.com>
Date:   Fri Oct 16 10:18:03 2020 +0200

    Added NetCDF file with van Genuchten parameters

commit 06ad4d1eeb5dfbc368d289496d40cbc7862cff54
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 c7978ffda75a1e23802ebe611485bb3c7819ff67
Author: julietbravo <bart@vanstratum.com>
Date:   Fri Sep 4 15:02:36 2020 +0200

    Fixed dynamic tile fraction for cases with open water

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

    Added water tile to time series statistics

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

    Added additional variables to surface cross-sections

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

    Modified modlsmcrosssection for new LSM

commit cfb67ebdff01dcb1e9c5caee228685c7a435290e
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 b66d74a81ca0df84cd2fe00689271f18be9df952
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jul 21 09:19:12 2020 +0200

    Fixed some MPI issues in new LSM

commit 600cf7c8baef59aad9a68d7df7c9358225c8f893
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 2b150cf1da4cac62c8f075afb4b4b77f399d5c26
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 5ab96410f234f02dbf62eb70f66b06a7dc27a8a9
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jul 7 11:53:21 2020 +0200

    Added restart functionality to new LSM

commit fe7ee50813fb863a9d15d7dc9abc6faf1b01629f
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 30f7d88376e5e6d2b027088919a981fc372fe893
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 ccd9203704aa102ef7b6cdb04d8c861dbbf9bbca
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jul 6 12:21:21 2020 +0200

    Added root water extraction to soil water budget

commit a08b2a55d642ccc1b6517a5409accfafbd0421bc
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 e2bb8edf036e01f2911fae5b01e13b1323a0effd
Author: julietbravo <bart@vanstratum.com>
Date:   Mon Jul 6 09:01:42 2020 +0200

    Added calculation of bulk (grid point mean) scalar BCs

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

    Working surface solver, with fluxes per tile

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

    Bugfix calculation canopy resistances

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

    Added calculation canopy and soil resistance

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

    Working tiled surface layer solver

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

    Start of tiled surface layer solver

commit 9b97bb6986df8415812ee41f6e69434a65834eb2
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 87aafb11966a0dce14a0829f07a73ef8ba7b0ad3
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 b41d465c1d4fb7e6ff0bd509cd2d89662270d868
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jun 30 14:39:31 2020 +0200

    Added calculation derived van Genuchten parameters

commit 7f7c4efb71aec947a721ce51259af7a1fc30bc23
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 495aa432ab2d2ea09f4f288bdb74260464fb3cef
Author: julietbravo <bart@vanstratum.com>
Date:   Tue Jun 30 11:08:45 2020 +0200

    Modified modlsmstat to work with the new LSM

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

    Minor changes new LSM

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

    Added soil grid and initialisation of soil

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

    Added homogeneous initialisation of LSM

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

    Added data structures for land-surface tiles

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

    Start at implemention realistic LSM

commit 5aaefd41648409269def3823622773fdd650481a
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 93d62083e5ec0859a125f671cf95d0ef70e20714
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Thu Oct 15 13:43:10 2020 +0200

    Renaming of emission related variables

commit bea90adf8bb8a1ab3ad71d4651e4dab716791a90
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 76d377c27d744a5448d083f9fd8d3c53c3e7f60e
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 1a19cd569de6426996c94e24a1f7a863769a6db5
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 9a2bedbf99a65b300640a55b45da5004f5d19b8f
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 74bdfad13342e19f26532dbf056ee14ccfb36342
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Mon Jun 29 16:49:25 2020 +0200

    Typo in modemisdata.f90

commit 19909689ffc946398ab5f769168a46ce562ab11b
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 8733870f68ed4bf2bd4175b6433995952799e87b
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 9df88ce817f20efb04fdfa02b6d041b0bbd754b7
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 080a1359a6454d1ad0e7ade6206d2532927aa025
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 71481ef261a13975e8a1a32ed67fa4da64751a3e
Author: Marco de Bruine <m.de.bruine@vu.nl>
Date:   Thu Feb 27 15:03:53 2020 +0100

    Realistic surface emissions (WIP)

commit d487543970fa5ef12881b7ac64e071470592d48d
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

commit 578358547ba4a4b0eabaef9b7918bdc0bf7da6bf
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 66dc2c312e8ef1cec016ac4d6308cb209ce29d95
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 cb8e7a74b2910edad777181c5f2885b0501f5a38
Author: Fredrik Jansson <jansson@cwi.nl>
Date:   Tue Apr 7 13:11:48 2020 +0200

    Add boundary nudging by BvS
  • Loading branch information
fjansson committed Jun 8, 2023
1 parent 450422e commit 52a3ff3
Show file tree
Hide file tree
Showing 21 changed files with 3,991 additions and 170 deletions.
Binary file added data/van_genuchten_parameters.nc
Binary file not shown.
6 changes: 6 additions & 0 deletions src/daleslib.f90
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ subroutine initialize(path,mpi_communicator,date,time)
!use modtilt, only : inittilt
!use modparticles, only : initparticles
use modnudge, only : initnudge
use modnudgeboundary, only : initnudgeboundary
!use modprojection, only : initprojection
use modchem, only : initchem
use modcanopy, only : initcanopy
Expand Down Expand Up @@ -170,6 +171,7 @@ subroutine initialize(path,mpi_communicator,date,time)
call initlsmstat
!call initparticles
call initnudge
call initnudgeboundary
call initbulkmicrostat
call initbudget
call initvarbudget
Expand Down Expand Up @@ -466,6 +468,7 @@ subroutine step
!use modtilt, only : tiltedgravity, tiltedboundary
!use modparticles, only : particles
use modnudge, only : nudge
use modnudgeboundary, only : nudgeboundary
!use modprojection, only : projection
use modchem, only : twostep
use modcanopy, only : canopy
Expand Down Expand Up @@ -525,6 +528,7 @@ subroutine step
! 3.4 EXECUTE ADD ONS
!------------------------------------------------------
call nudge
call nudgeboundary
! call dospecs
! call tiltedgravity

Expand Down Expand Up @@ -669,6 +673,7 @@ subroutine finalize
!use modtilt, only : exittilt
!use modparticles, only : exitparticles
use modnudge, only : exitnudge
use modnudgeboundary, only : exitnudgeboundary
use modcanopy, only : exitcanopy

implicit none
Expand All @@ -681,6 +686,7 @@ subroutine finalize
call exitlsmstat
!call exitparticles
call exitnudge
call exitnudgeboundary
call exitsampling
call exitquadrant
call exitsamptend
Expand Down
1 change: 1 addition & 0 deletions src/modboundary.f90
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ subroutine boundary

call cyclicm
call cyclich

call topm
call toph
end subroutine boundary
Expand Down
247 changes: 247 additions & 0 deletions src/moddatetime.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,247 @@
!> \ file moddatetime.f90
!! Utility module for date and time calculations

!>
!! \author Marco de Bruine, VU
! This file is part of DALES.
!
! DALES is free software; you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 3 of the License, or
! (at your option) any later version.
!
! DALES is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
!
! Copyright 1993-2020 Delft University of Technology, Wageningen
! University, Utrecht University, KNMI, Vrije Universiteit Amsterdam
!

module moddatetime

implicit none

save

! Namelist variables
logical :: l_datetime = .false.
integer :: startyear = 0, &
startmonth = 0, &
startday = 0, &
timezone = 0

integer :: jday
integer, dimension(6) :: datex = 0, prevday = 0, nextday = 0

contains

subroutine initdatetime
! Using the namelist, construct datetime relevant variables

use modmpi, only : myid, comm3d, mpi_logical, D_MPI_BCAST
use modglobal, only : ifnamopt, fname_options, xtime

implicit none

! Auxiliary variables
integer :: ierr

! Read & broadcast namelist DATETIME -----------------------------------
namelist/NAMDATETIME/ l_datetime, startyear, startmonth, startday, timezone

if (myid == 0) then

open(ifnamopt, file=fname_options, status='old', iostat=ierr)
read(ifnamopt, NAMDATETIME, iostat=ierr)

if (ierr > 0) then
print *, 'iostat error: ', ierr
stop 'ERROR: Problem in namoptions NAMDATETIME'
endif

write(6, NAMDATETIME)
close(ifnamopt)

endif

call d_mpi_bcast(l_datetime, 1, 0, comm3d, ierr)
call d_mpi_bcast(startyear, 1, 0, comm3d, ierr)
call d_mpi_bcast(startmonth, 1, 0, comm3d, ierr)
call d_mpi_bcast(startday, 1, 0, comm3d, ierr)
call d_mpi_bcast(timezone, 1, 0, comm3d, ierr)

! Initialize datetime array -----------------------------------------------
if (l_datetime) then

datex(1) = startyear ! year
datex(2) = startmonth ! month

if (xtime + timezone > 24) then
datex(3) = startday + 1 ! day (LT is a day ahead of GMT)
elseif (xtime + timezone < 0) then
datex(3) = startday - 1 ! day (LT is a day behind GMT)
else
datex(3) = startday ! day
endif

datex(4) = mod(int(xtime) + timezone + 24, 24) ! hour
datex(5) = 0 ! minutes
datex(6) = 0 ! seconds

! Initialize julian day number --------------------------------------------
jday = julday(datex(1), datex(2), datex(3))

call caldat(jday-1, prevday(1), prevday(2), prevday(3))
call caldat(jday+1, nextday(1), nextday(2), nextday(3))

! Catch non specified starting date while l_datetime = True ---------------
! We check on date only, because time is filled from variables shared with
! other functionalities, that thus have non-zero values.
if (sum(datex(1:3)) == 0) stop 'ERROR: Trying to use datetime functionality without specified date.'
endif
end subroutine initdatetime

subroutine datetime
! --------------------------------------------------------------------------
!
! Keep track of the (local) date and time by updating the datex array.
!
! --------------------------------------------------------------------------

use modglobal, only : rtimee, xtime
! TODO: Check if rtimee really is seconds of if it is scaled

implicit none
integer :: xhr, itimee

itimee = int(rtimee)
xhr = mod(itimee/3600 + int(xtime) + timezone + 24, 24)

if ( xhr < datex(4) ) then ! New day
jday = jday + 1
call caldat(jday, datex(1), datex(2), datex(3))
endif

datex(4) = xhr ! hours
datex(5) = mod(itimee/60, 60) ! minutes
datex(6) = mod(itimee, 60) ! seconds

end subroutine datetime

subroutine caldat(julian, iyyy, mm, id)
!--------------------------------------------------------------------------
! caldat
!
! purpose
! -------
! calculate date from given julian day
!
! parameters
! ----------
! on input : julday contains the julian day
! on output: mm, id, iyyy contain month, day and year
!
! reference
! ---------
! J. Meeus, "Astronomical formulea for calculators, 4th Edition" 1988
!--------------------------------------------------------------------------
implicit none

! input/output
integer,intent(in) :: julian
integer,intent(out) :: mm
integer,intent(out) :: id
integer,intent(out) :: iyyy

! local
integer,parameter :: igreg=2299161
integer :: jalpha, ja, jb, jc, jd, je
!
! handle gregorian and julian date
!
if ( julian >= igreg )then
jalpha=int(((julian-1867216)-0.25)/36524.25)
ja=julian+1+jalpha-int(0.25*jalpha)
else
ja=julian
end if
jb=ja+1524
jc=int(6680.+((jb-2439870)-122.1)/365.25)
jd=365*jc+int(0.25*jc)
je=int((jb-jd)/30.6001)
id=jb-jd-int(30.6001*je)
mm=je-1
if ( mm > 12 ) mm=mm-12
iyyy=jc-4715
if ( mm > 2 ) iyyy=iyyy-1
!
! handle dates before 0 AD
!
if ( iyyy <= 0 ) iyyy=iyyy-1

end subroutine caldat

integer function julday(iy,mm,id)
!-----------------------------------------------------------------------
!**** julday
!
! purpose
! -------
! calculate julian day from given date
!
! parameters
! ----------
! on input : mm, id, iyyy contain month, day and year
! on output: julday contains the julian day
!
! reference
! ---------
! J. Meeus, "Astronomical formulea for calculators, 4th Edition" 1988
!-----------------------------------------------------------------------
implicit none

! input, output
integer,intent(in) :: mm ! month
integer,intent(in) :: id ! day
integer,intent(in) :: iy ! year

! local
integer,parameter :: igreg=15+31*(10+12*1582)
integer :: jy, jm, ja, iyyy

! handle dates before 0 AD
!
iyyy=iy
if ( iy == 0 ) then
stop 'julday: ERROR invalid year 0 AD'
end if
if ( iy < 0 ) then
iyyy=iy+1
end if
!
!calculate julian day from date in gregorian calendar
!
if ( mm > 2 ) then
jy=iyyy
jm=mm+1
else
jy=iyyy-1
jm=mm+13
end if
julday=int(365.25*jy)+int(30.6001*jm)+id+1720995
!
!handle julian calender
!
if ( id+31*(mm+12*iyyy) >= igreg ) then
ja=int(0.01*jy)
julday=julday+2-ja+int(0.25*ja)
end if

end function julday

end module moddatetime
64 changes: 64 additions & 0 deletions src/modemisdata.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
!> \file modemisdata.f90
!! Variable definitions and auxilary routines for emissions

!>
!! Variable definitions and auxilary routines for emission
!>
!! This routine should have no dependency on any other routine, save
!perhaps modglobal or modfields.
!! \author Marco de Bruine, VU
!! \todo Documentation
!! \par Revision list
! This file is part of DALES.
!
! DALES is free software; you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 3 of the License, or
! (at your option) any later version.
!
! DALES is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
!
! Copyright 1993-2020 Delft University of Technology, Wageningen
! University, Utrecht University, KNMI, Vrije Universiteit Amsterdam
!
! TODO INTEGRATION WITH MODCHEM, possibly switch?
! For example, nchem, firstchem etc, but also structure for species
! 'location', i.e. switch scalar field represents which species?

module modemisdata

implicit none
save

integer :: iname
! ---------------------------------------------------------------------!
! Namelist variables !
! ---------------------------------------------------------------------!

logical :: l_emission = .false. ! scalar emission switch
integer :: kemis = -1, & ! no. of layers to include for emission
svskip = 0 ! no. scalars to exclude for emission

character(len = 6), dimension(100) :: &
emisnames = (/ (' ', iname=1, 100) /) ! list with scalar names,
! each name must(!) be 6 characters long for now

! Interaction with AGs ------------------------------------------------
integer :: svco2ags = -1 ! Scalar field number for AGs soil respiration
integer :: svco2veg = -1 ! Scalar field number for AGs net CO2 flux
integer :: svco2sum = -1 ! Scalar field which holds the sum of CO2
integer, allocatable :: co2fields(:) ! Array defnining co2 fields for AGs

! ---------------------------------------------------------------------!
! Main variables !
! ---------------------------------------------------------------------!

real, allocatable :: emisfield(:,:,:,:,:) !array for emission fields

end module modemisdata
Loading

0 comments on commit 52a3ff3

Please sign in to comment.