Commit e3ac4ca0 authored by kbk's avatar kbk
Browse files

added supoort for spm - Ruiz

parent de1912d2
......@@ -46,17 +46,6 @@
allocate(eps(I3DFIELD),stat=rc) ! 3D field for dissipation
if (rc /= 0) stop 'init_3d: Error allocating memory (eps)'
#ifdef OLD_TURBULENCE
allocate(tkeo(I3DFIELD),stat=rc) ! 3D field for turbulent kinetic energy
if (rc /= 0) stop 'init_3d: Error allocating memory (tkeo)'
allocate(P(I3DFIELD),stat=rc)
if (rc /= 0) stop 'init_3d: Error allocating memory (P)'
allocate(B(I3DFIELD),stat=rc)
if (rc /= 0) stop 'init_3d: Error allocating memory (B)'
#endif
allocate(SS(I3DFIELD),stat=rc) ! 3D field for shear frequency
if (rc /= 0) stop 'init_3d: Error allocating memory (SS)'
......@@ -88,7 +77,7 @@
allocate(spm_ws(I3DFIELD),stat=rc) ! Sinking velocity
if (rc /= 0) stop 'init_3d: Error allocating memory (spm_ws)'
allocate(spm_pool(I2DFIELD),stat=rc) ! Sinking velocity
allocate(spm_pool(I2DFIELD),stat=rc) ! Pool of spm
if (rc /= 0) stop 'init_3d: Error allocating memory (spm_pool)'
#endif
......
!$Id: m3d.F90,v 1.18 2004-05-04 09:23:51 kbk Exp $
!$Id: m3d.F90,v 1.19 2004-06-15 08:25:57 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -29,7 +29,7 @@
use internal_pressure, only: init_internal_pressure, do_internal_pressure
use internal_pressure, only: ip_method
#endif
#ifndef NO_SUSP_MATTER
#ifdef SPM
use suspended_matter, only: init_spm, do_spm
#endif
use variables_3d
......@@ -44,6 +44,7 @@
logical :: calc_temp=.true.
logical :: calc_salt=.true.
logical :: calc_spm=.false.
logical :: hotstart_spm=.false.
logical :: bdy3d=.false.
integer :: bdyfmt_3d,bdyramp_3d
character(len=PATH_MAX) :: bdyfile_3d
......@@ -52,7 +53,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: m3d.F90,v $
! Revision 1.18 2004-05-04 09:23:51 kbk
! Revision 1.19 2004-06-15 08:25:57 kbk
! added supoort for spm - Ruiz
!
! Revision 1.18 2004/05/04 09:23:51 kbk
! hydrostatic consistency criteria stored in .3d.nc file
!
! Revision 1.17 2004/04/23 09:03:59 kbk
......@@ -246,6 +250,10 @@
read(NAMLST,m3d)
! rewind(NAMLST)
#ifndef SPM
if(calc_spm) stop 'To use SPM you have to recompile with -DSPM'
#endif
! Allocates memory for the public data members - if not static
call init_variables_3d(runtype)
......@@ -332,9 +340,11 @@
T = _ZERO_ ; S = _ZERO_ ; rho = _ZERO_
if(calc_temp) call init_temperature(1)
if(calc_salt) call init_salinity(1)
#ifndef NO_SUSP_MATTER
if(calc_spm) call init_spm(1)
end if
#endif
#ifndef NO_BAROCLINIC
if (runtype .eq. 3 .or. runtype .eq. 4) then
call init_eqstate()
#ifndef PECS
call do_eqstate()
......@@ -346,6 +356,10 @@
end if
end if
#endif
#ifdef SPM
if(calc_spm) call init_spm(hotstart_spm,runtype)
if(runtype.ne.4) call init_advection_3d(2)
#endif
if (bdy3d) call init_bdy_3d()
......@@ -430,10 +444,7 @@
STDERR 'NO_ADVECT 3D'
#endif
#ifdef CONST_VISC
num = 1.000e-4
nuh = 1.000e-5
#else
#ifndef CONSTANT_VISCOSITY
#ifndef NO_BOTTFRIC
if (kmax .gt. 1) then
call stresses_3d()
......@@ -448,15 +459,21 @@
if(runtype .eq. 4) then ! prognostic T and S
if (calc_temp) call do_temperature(n)
if (calc_salt) call do_salinity(n)
#ifndef NO_SUSP_MATTER
if (calc_spm) call do_spm()
end if
#endif
#ifndef NO_BAROCLINIC
if(runtype .eq. 4) then
#ifndef PECS
call do_eqstate()
#endif
end if
#endif
#ifdef SPM
if (calc_spm) call do_spm()
#endif
UEx=_ZERO_ ; VEx=_ZERO_
if (kmax .gt. 1) then
#ifndef NO_BOTTFRIC
......
This diff is collapsed.
! Remember to update this value if you add more 3D arrays.
#ifdef UV_TVD
#ifndef NO_SUSP_MATTER
integer, parameter :: n3d_fields=29
#else
integer, parameter :: n3d_fields=26
#endif
#else
#ifndef NO_SUSP_MATTER
integer, parameter :: n3d_fields=22
#else
integer, parameter :: n3d_fields=19
#endif
#endif
! Number of vertical layers in z,u,v columns
INTEGER :: kmin(I2DFIELD)
INTEGER :: kumin(I2DFIELD)
......
#$Id: Rules.make,v 1.10 2004-06-15 07:57:48 kbk Exp $
#$Id: Rules.make,v 1.11 2004-06-15 08:25:57 kbk Exp $
#
# This file contains rules which are shared between multiple Makefiles.
# This file is quite complicated - all compilation options are set in this
......@@ -31,8 +31,8 @@ ifeq ($(GETM_NO_BAROCLINIC),true)
DEFINES += -DNO_BAROCLINIC
endif
ifeq ($(GETM_NO_SUSP_MATTER),true)
DEFINES += -DNO_SUSP_MATTER
ifeq ($(GETM_SPM),true)
DEFINES += -DSPM
endif
# The compilation mode is obtained from $COMPILATION_MODE
......
!$Id: init_3d_ncdf.F90,v 1.6 2004-05-04 09:23:51 kbk Exp $
!$Id: init_3d_ncdf.F90,v 1.7 2004-06-15 08:25:57 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -30,7 +30,10 @@
! !REVISION HISTORY:
!
! $Log: init_3d_ncdf.F90,v $
! Revision 1.6 2004-05-04 09:23:51 kbk
! Revision 1.7 2004-06-15 08:25:57 kbk
! added supoort for spm - Ruiz
!
! Revision 1.6 2004/05/04 09:23:51 kbk
! hydrostatic consistency criteria stored in .3d.nc file
!
! Revision 1.5 2003/12/16 12:51:04 kbk
......@@ -392,15 +395,24 @@
if (save_spm) then
fv = spm_missing
mv = spm_missing
err = nf_def_var(ncid,'spm_pool',NF_REAL,3,f3_dims,spmpool_id)
if (err .NE. NF_NOERR) go to 10
vr(1) = 0.
vr(2) = 10.
call set_attributes(ncid,spmpool_id,long_name='bottom spm pool', &
units='kg/m2', &
FillValue=fv,missing_value=mv,valid_range=vr)
vr(1) = 0.
vr(2) = 30.
err = nf_def_var(ncid,'spm',NF_REAL,4,f4_dims,spm_id)
if (err .NE. NF_NOERR) go to 10
call set_attributes(ncid,spm_id, &
long_name='suspended particulate matter',units='?????', &
long_name='suspended particulate matter', &
units='kg/m3', &
FillValue=fv,missing_value=mv,valid_range=vr)
end if
#endif
! globals
err = nf_put_att_text(ncid,NF_GLOBAL,'title',LEN_TRIM(title),title)
if (err .NE. NF_NOERR) go to 10
......
!$Id: ncdf_3d.F90,v 1.5 2004-05-04 09:23:51 kbk Exp $
!$Id: ncdf_3d.F90,v 1.6 2004-06-15 08:25:57 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -37,7 +37,7 @@
integer :: salt_id,temp_id,sigma_t_id
integer :: tke_id,num_id,nuh_id,eps_id
#ifdef SPM
integer :: spm_id
integer :: spmpool_id,spm_id
#endif
integer :: xlen,ylen,zlen
integer, parameter :: size_3d=9000000
......@@ -53,6 +53,7 @@
REALTYPE, parameter :: num_missing=-9999.0
REALTYPE, parameter :: eps_missing=-9999.0
#ifdef SPM
REALTYPE, parameter :: spmpool_missing=-9999.0
REALTYPE, parameter :: spm_missing=-9999.0
#endif
......@@ -61,7 +62,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_3d.F90,v $
! Revision 1.5 2004-05-04 09:23:51 kbk
! Revision 1.6 2004-06-15 08:25:57 kbk
! added supoort for spm - Ruiz
!
! Revision 1.5 2004/05/04 09:23:51 kbk
! hydrostatic consistency criteria stored in .3d.nc file
!
! Revision 1.4 2003/12/16 12:51:04 kbk
......
!$Id: save_3d_ncdf.F90,v 1.8 2004-05-04 09:23:51 kbk Exp $
!$Id: save_3d_ncdf.F90,v 1.9 2004-06-15 08:25:57 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -29,7 +29,7 @@
#endif
use variables_3d, only: tke,num,nuh,eps
#ifdef SPM
use variables_3d, only: spm
use variables_3d, only: spm_pool,spm
#endif
use parameters, only: g,rho_0
IMPLICIT NONE
......@@ -45,7 +45,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: save_3d_ncdf.F90,v $
! Revision 1.8 2004-05-04 09:23:51 kbk
! Revision 1.9 2004-06-15 08:25:57 kbk
! added supoort for spm - Ruiz
!
! Revision 1.8 2004/05/04 09:23:51 kbk
! hydrostatic consistency criteria stored in .3d.nc file
!
! Revision 1.7 2003/12/16 12:47:11 kbk
......@@ -311,6 +314,17 @@
kmin,az,spm,spm_missing,ws)
err = nf_put_vara_real(ncid, spm_id, start, edges, ws)
if (err .NE. NF_NOERR) go to 10
!spm pool is a 2d magnitude
start(1) = 1
start(2) = 1
start(3) = n3d
edges(1) = xlen
edges(2) = ylen
edges(3) = 1
call cnv_2d(imin,jmin,imax,jmax,az,spm_pool,spmpool_missing, &
imin,jmin,imax,jmax,ws)
err = nf_put_vara_real(ncid, spmpool_id, start, edges, ws)
if (err .NE. NF_NOERR) go to 10
end if
#endif
......
!$Id: output.F90,v 1.8 2004-03-29 15:35:52 kbk Exp $
!$Id: output.F90,v 1.9 2004-06-15 08:25:57 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -54,7 +54,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: output.F90,v $
! Revision 1.8 2004-03-29 15:35:52 kbk
! Revision 1.9 2004-06-15 08:25:57 kbk
! added supoort for spm - Ruiz
!
! Revision 1.8 2004/03/29 15:35:52 kbk
! possible to store calculated mean fields
!
! Revision 1.7 2003/12/16 16:50:41 kbk
......@@ -168,6 +171,12 @@
save_spm = .false.
end if
if (runtype .eq. 2) then
save_strho = .false.
save_s = .false.
save_t = .false.
end if
call file_names(runid,myid)
if(save_2d) then
......@@ -332,6 +341,9 @@
#ifndef NO_BAROCLINIC
use m3d, only: T,S
#endif
#endif
#ifdef SPM
use m3d, only: spm,spm_pool,calc_spm,hotstart_spm
#endif
IMPLICIT NONE
!
......@@ -352,6 +364,7 @@
integer, save :: n=0
logical, save :: continuous=.false.
integer :: jd,secs
character(len=19) :: timestr_out
REALTYPE :: dt
!
!EOP
......@@ -383,6 +396,13 @@
LEVEL3 'saving 3D baroclinic variables'
write(RESTART) T,S
end if
#endif
#ifdef SPM
if(save_spm) then
LEVEL3 'saving spm'
write(RESTART) spm
write(RESTART) spm_pool
end if
#endif
end if
#endif
......@@ -415,6 +435,18 @@
LEVEL3 'reading 3D baroclinic variables'
read(RESTART) T,S
end if
#endif
#ifdef SPM
if(calc_spm) then
if (hotstart_spm) then
LEVEL3 'reading spm variables'
read(RESTART) spm
read(RESTART) spm_pool
else
LEVEL3 'spm variables not read from hotstart file'
LEVEL3 'set spm_init_method=0 to read them from hotstart file'
end if
end if
#endif
end if
#endif
......@@ -428,7 +460,11 @@
FATAL 'start time given in getm.inp does not match time'
FATAL 'read from hot-start file'
FATAL 'from getm.inp: ',julianday,secondsofday
call write_time_string(julianday,secondsofday,timestr_out)
LEVEL3 timestr_out
FATAL 'from hotstart: ',jd,secs
call write_time_string(jd,secs,timestr_out)
LEVEL3 timestr_out
stop 'restart_file()'
end if
if (dt .ne. timestep) then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment