netcdf_output_mod Module


determine output units (see table 1 in Stohl et al., ACP 2005



write metadata to netCDF file




Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: deflate_level = 5
logical, public, parameter :: min_size = .false.
integer, public :: tpointer = 0
integer, public :: tpointer_part = 0
integer, public :: ppointer_part = 0
integer, public :: partinitpointer = 0
integer, public :: partinitpointer1 = 0
character(len=255), public :: ncfname
character(len=255), public :: ncfnamen
character(len=255), public :: ncfname_part
character(len=255), public :: ncfname_partinit
character(len=255), public :: ncfname_part_end
integer, public, allocatable, dimension(:) :: specID
integer, public, allocatable, dimension(:) :: specIDppt
integer, public, allocatable, dimension(:) :: wdspecID
integer, public, allocatable, dimension(:) :: ddspecID
integer, public, allocatable, dimension(:) :: specIDn
integer, public, allocatable, dimension(:) :: specIDnppt
integer, public, allocatable, dimension(:) :: wdspecIDn
integer, public, allocatable, dimension(:) :: ddspecIDn
integer, public, allocatable, dimension(:) :: recconcID
integer, public, allocatable, dimension(:) :: recpptvID
integer, public :: timeID
integer, public :: timeIDn
integer, public :: timeIDpart
integer, public, dimension(6) :: dimids
integer, public, dimension(6) :: dimidsn
integer, public, dimension(5) :: depdimids
integer, public, dimension(5) :: depdimidsn
integer, public :: partIDi
integer, public :: tIDi
integer, public :: lonIDi
integer, public :: latIDi
integer, public :: levIDi
integer, public :: relIDi
integer, public :: pvIDi
integer, public :: prIDi
integer, public :: qvIDi
integer, public :: rhoIDi
integer, public :: ttIDi
integer, public :: uIDi
integer, public :: vIDi
integer, public :: wIDi
integer, public :: topoIDi
integer, public :: trIDi
integer, public :: hmixIDi
integer, public, allocatable, dimension(:) :: massIDi
real, public :: eps
logical, public, parameter :: write_releases = .true.
logical, public, parameter :: write_vol = .false.
logical, public, parameter :: write_area = .false.
logical, public :: topo_written = .false.
logical, public :: mass_written = .false.
logical, public :: massav_written = .false.
real, public :: xp1
real, public :: yp1
real, public :: xp2
real, public :: yp2

Subroutines

public subroutine alloc_netcdf()

Arguments

None

public subroutine dealloc_netcdf()

Arguments

None

public subroutine nf90_err(status)

netcdf error message handling

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: status

public subroutine writeheader_netcdf(lnest)

Create netcdf file and write header/metadata information lnest = .false. : Create main output file lnest = .true. : Create nested output file

Read more…

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: lnest

public subroutine concoutput_netcdf(itime, outnum, gridtotalunc, wetgridtotalunc, drygridtotalunc)

Variables: * outnum number of samples * ncells number of cells with non-zero concentrations * sparse .true. if in sparse matrix format, else .false. * tot_mu 1 for forward, initial mass mixing ration for backw. runs * *

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: itime
real, intent(in) :: outnum
real, intent(out) :: gridtotalunc
real(kind=dep_prec), intent(out) :: wetgridtotalunc
real(kind=dep_prec), intent(out) :: drygridtotalunc

public subroutine concoutput_nest_netcdf(itime, outnum)

Variables: * itime current simulation time * outnum number of samples * *

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: itime
real, intent(in) :: outnum

public subroutine create_particles_initialoutput(itime, idate, itime_start, idate_start)

This subroutine creates an initial particle positions and properties * NetCDF file: partinit_xxx.nc * The release time, release number and positions, together with all fields * specified in the PARTOPTIONS option file will saved. * * Author: L. Bakels 2022 * *

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: itime
integer, intent(in) :: idate
integer, intent(in) :: itime_start
integer, intent(in) :: idate_start

public subroutine wrt_part_initialpos(itime, istart, iend)

This subroutine saves initial particle positions, release time and * releasenumber to a NetCDF file created in create_particles_initialoutput * evertime a new particle is spawned. * * Author: L. Bakels 2022 * *

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: itime
integer, intent(in) :: istart
integer, intent(in) :: iend

public subroutine partinit_netcdf(field, fieldname, imass, ncid)

This subroutine saves properties chosen by the user in PARTOPTIONS * to a NetCDF file created in create_particles_initialoutput. * This happens whenever a new particle is spawned. * * Author: L. Bakels 2022 * *

Read more…

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: field(:)
character(len=2), intent(in) :: fieldname
integer, intent(in) :: imass
integer :: ncid

public subroutine writeheader_partoutput(itime, idate, itime_start, idate_start)

This subroutine creates a file (partoutput_xxx.nc), where every time * interval particle properties specified in the PARTOPTIONS option file * are saved to. Running options are saved as header informtion to this * file as well. * * Author: L. Bakels 2021 * *

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: itime
integer, intent(in) :: idate
integer, intent(in) :: itime_start
integer, intent(in) :: idate_start

public subroutine open_partoutput_file(ncid, np)

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: ncid
integer, intent(in), optional :: np

public subroutine close_partoutput_file(ncid)

Arguments

Type IntentOptional Attributes Name
integer :: ncid

public subroutine open_partinit_file(ncid)

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: ncid

public subroutine update_partoutput_pointers(itime, ncid)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: itime
integer, intent(in), optional :: ncid

public subroutine partoutput_netcdf(itime, field, np, imass, ncid)

Writing a field from PARTOPTIONS to partoutput_xxx.nc created in * writeheader_partoutput * *
Author: L. Bakels 2021 * *

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: itime
real, intent(in) :: field(:)
integer, intent(in) :: np
integer, intent(in) :: imass
integer, intent(in) :: ncid

public subroutine readpartpositions_netcdf(ibtime, ibdate)

IPIN=2: restarting from a partoutput_xxx.nc file written by a previous * run, depending on what PARTOPTIONS the user has chosen, this * option might not be possible to use * * Author: L. Bakels 2022 * *

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ibtime
integer, intent(in) :: ibdate

public subroutine readinitconditions_netcdf()

IPIN=3: starting a run from a user defined initial particle conditions, * more on how to create such a file can be found in the manual * IPIN=4: restarting a run, while also reading in the initial particle * conditions * * Author: L. Bakels 2022 * *

Read more…

Arguments

None