Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Build and statics
*.csv
*.mod
*.o
_build
docs/_build
docs/_static
docs/_templates
Expand Down
22 changes: 22 additions & 0 deletions projects/MICOM/Makefile.prj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Makefile for BLOM run
#========================================================================

# Vertical velocities
#------------------------------------------------------------------------
#fl01 = -Dw_2dim # Turn off vertical velocities.
#fl01 = -Dw_3dim # Compute 3D vertical velocities.
fl01 = -Dw_explicit # Explicit 3D vertical velocities.


# Time integration scheme
#------------------------------------------------------------------------
#fl02 = -Dtime_analytical

# Isopycnic model
#------------------------------------------------------------------------
fl03 = -Disopycnic_model

#========================================================================

ORM_FLAGS= -D$(PROJECT) \
$(fl01)$(fl02)$(fl03)
86 changes: 86 additions & 0 deletions projects/MICOM/kill_zones.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
SUBROUTINE kill_zones
!==========================================================================
!
! Purpose
! -------
!
! Defines the limits of the domain.
! If a trajectory is outside the domain the subroutine will identify it
! with a flag (nend)
!
! nend = 0 is reserved to the time limit
! nend = 1 is reserved to trajectories reaching the surface
!
! ==========================================================================


USE mod_traj
USE mod_domain
USE mod_tracervars

IMPLICIT NONE

INTEGER :: nexit, itrac, numexit

nend = -1

SELECT CASE(exitType)

! Exit domain defined by the boxes [ienw, iene]x[jens, jenn]
! in the namelist
CASE(1)
DO nexit = 1, 10
IF(ienw(nexit) <= x1 .AND. x1 <= iene(nexit) .AND. &
jens(nexit) <= y1 .AND. y1 <= jenn(nexit) ) THEN
nend = nexit +1
END IF
END DO

! Exit domain defined by the value of tracers in the namelist tracere
CASE(2)

numexit = MINLOC(tracerchoice, DIM=1,MASK=(tracerchoice==999)) - 1

DO nexit = 1, numexit
itrac = tracerchoice(nexit)

IF ( maxormin(nexit)*tracervalue(itrac)>= maxormin(nexit)*tracere(nexit) ) THEN
nend = nexit +1
END IF

END DO

! Exit domain defined by the value of tracers in the namelist tracere and domain
CASE(3)

! First thermodynamic killing zone
numexit = MINLOC(tracerchoice, DIM=1,MASK=(tracerchoice==999)) - 1

DO nexit = 1, numexit
itrac = tracerchoice(nexit)

IF ( maxormin(nexit)*tracervalue(itrac)>= maxormin(nexit)*tracere(nexit) ) THEN
nend = nexit +1
END IF

END DO

! Next the geographical killing zone
DO nexit = 1, 10
IF(ienw(nexit) <= x1 .AND. x1 <= iene(nexit) .AND. &
jens(nexit) <= y1 .AND. y1 <= jenn(nexit) ) THEN
nend = nexit +1 + numexit
END IF
END DO

! If the exit domained is defined in a different way:
! - Read from a file
! - Defined by curve, no linear shape, ...
! This must be hard coded below.

CASE(4)
PRINT*, 'Hard coded limits of the domain'

END SELECT

END SUBROUTINE kill_zones
220 changes: 220 additions & 0 deletions projects/MICOM/namelist_MICOM.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
&INIT_GRID_DESCRIPTION
! Direction of the grid (1 - E->W, S->N, B->U)
griddir = -1,1,1

! Does the netcdf data start with a zero index?
zeroindx = .FALSE.

l_onestep = .TRUE.

! Describe filenames
physDataDir = '/projects/NS9560K/noresm/cases/NHISTfrc2_f09_tn14_20191025/ocn/hist/'
physPrefixForm = 'NHISTfrc2_f09_tn14_20191025.micom.hm.',
dateformat = 'YYYY-MM'

fileSuffix = '.nc', ! suffix of files, e.g. ".nc"

! Describe variable names
ueul_name = 'uflx', ! name of resolved zonal velocity
veul_name = 'vflx', ! ---- " ------- meridional
w_name = 'wflx', ! name of diagnosed vertical velocity
usgs_name = '', ! name of eddy induced zonal velocity
vsgs_name = '', ! ---- " ------- meridional
/

&INIT_GRID_SIZE
! Size of global grid
imt = 360, ! number of global i points
jmt = 384, ! number of global j points
km = 53, ! number of global k points

iperio = 1, ! zonal periodic
jperio = 2, ! meridional boundary conditions

topoDataDir = './', ! directory of grid data

hgridFile = 'grid.nc', ! file with dx, dy etc
!dy_name = 'pdy', ! name of dy at T point
dyu_name = 'udy', ! dy at U point
!dx_name = 'pdx', ! name of dx at T point
dxv_name = 'vdx', ! dx at V point

dzt_name = 'dp' ! name of 3D dp at T point
!dzu_name = 'dp' ! --- " --- dp at U point
!dzv_name = 'dp' ! --- " --- dp at V point

/

&INIT_GRID_SUBDOMAIN
l_subdom = .FALSE. ! Initialise subdomain
imindom = 50 ! Eastern and western wall for subdomain
imaxdom = 100
jmindom = 50 ! Southern and northern wall for subdomain
jmaxdom = 100
/

&INIT_GRID_TIME
ngcm_step = 1, ! time between two time levels
! if ngcm_unit = 5, then ngcm_step = 3 means 3 months
ngcm_unit = 5, ! units of ngcm

iter = 120, ! number of subcycles between time levels stopped
/

&INIT_START_DATE
startsec = 0, ! start time
startmin = 0,
starthour = 0,
startday = 1, ! start date
startmon = 1,
startyear = 2000,
noleap = .TRUE., ! don't use leap years?
mon30day = .true.
/

&INIT_RUN_TIME
! Loop run
loopYears = .TRUE., ! make a time loop to run
! e.g. 1000 years using only 100 years of data
loopStartYear = 2000, ! year to start loop from
loopEndYear = 2000, ! last year of loop

! Verbose
log_level = 1 ! precise 1->3->5 verbose

! Information of run time
intrun = 121 ! number of time steps for run
/

&INIT_WRITE_TRAJ
write_frec = 1 ! 1 = write at time intervals of gcm datasets (each ints)
! 2 = write at each time iteration
! 3 = write each spatial grid-crossing
! 4 = write all the time steps
! 5 = write only start and end positions
!write_form = 1,
write_form = 0,
outDataDir = './output/MICOM/',
outDataFile = 'output',

timeformat = 1, ! Format of the time array
! 0 - tt / 1 - ts / 2 - YYYY, MM, DD, HH
l_compress = .FALSE. ! Compress _run.csv files on exceeding 2GB filesize using gzip
/

&INIT_SEEDING
nff = 1, ! = 1 run forward trajectories
! = -1 run backwards
isec = 1, ! = 1 start on zonal cell wall
! = 2 start on meridional cell wall
! = 3 start on vertical wall
idir = 1, ! = 1 start only when flux > 0
! = -1 only when flux < 0
nqua = 2, ! number of trajectories can be set by
! = 1 constant number of particles in all seeding cells
! set by partQuant (particles / gridcell)
! = 2 Each particle reflects mass transport at seeding.
! set by partQuant (m3/s or kg/s per particle)
! = 3 Each particle reflects air/water mass/volume at seeding.
! set by partQuant in m3 or kg per particle
nsdtraj = 10, ! number of trajectories to allocate per seeding cell (used for allocation if nqua > 1)
partquant = 5e6, ! particles/gridcell or m3s-1/particle or m3/particle
loneparticle = 0, ! start only one trajectory for debugging
seedtype = 1, ! = 1 seed using ist,jst,kst (below)
! = 2 seed using file with start positions

! when seedtype = 1
! gulf stream
ist1 = 30, ! seed in box in range i = [ist1,ist2]
ist2 = 35,
jst1 = 266, ! j = [jst1,jst2]
jst2 = 266,
kst1 = 1, ! k = [kst1,kst2]
kst2 = 53,
! when seedtype = 2
seeddir = '', ! directory for seed files
seedfile = '', ! name of seed file


seedtime = 1, ! = 1 seed only for specific times
! = 2 seed using file with start positions

! when seedtime = 1
tst1 = 1, ! seed only between tst1 and tst2
tst2 = 5,

! when seedtime = 2
timefile = '', ! name of seed file
/

&INIT_TRACERS
l_tracers = .True. ! Should we evaluate tracers along the trajectories?

! Tracer name (description)
tracername = 'temp','saln','depth'
! Tracer unit (description)
tracerunit = 'degC','PSU','m'

! Name of the variable in the netcdf (if it's read)
tracervarname = 'temp','saln','dz'

! Action (read or compute)
traceraction = 'read','read','read'

! Minimum and maximum value of the binning
tracermin = -3, 32, -11000
tracermax = 33, 38, 0

! Dimension of the tracer
tracerdimension = 3D, 3D, 3D
/

&INIT_TRACERS_SEEDING
! minimum and maximum value for seeding
! same order as in tracername
!tracer0min = 2, 34.9,
!tracer0max = 4, 35.0,
/

&INIT_KILLZONES
timax = 75000 ! time limit for traj [days]
l_nosurface = .TRUE.

exitType = 1
! If exitType = 1: killing zone defined by a box
! IMPORTANT -> The maximum number of boxes than can be defined are 10
! ienw,iene are western and eastern i indices of killzone
! jens,jenn are southern and northern j indices of killzone
! ienw = 0, 500,
! iene = 100, 1000,
! jens = 200, 450,
! jenn = 300, 470,
! sets up two killzones, the first i = [0,100], j = [200,300]
! the other i = [500,1000], j = [450,470]
ienw = 10,10, ! west indices of killzones
iene = 150,150, ! east indices of killzones
jens = 365, 365, ! south indices of killzones
jenn = 366, 366, ! north indices of killzones

! If exitType = 2: killing zone defined by tracer value
! Tracerchoice defines which tracer is used for the killing zone
! it could be different
!tracerchoice = 1, 2
!tracere = 25, 35
!maxormin = 1, -1
! This set up defines a killing zone by the 25C isotherm (maximum)
! and the 35psu isohaline (minimum)

/

&INIT_POSTPROCESS
l_psi = .FALSE. ! Compute stream Functions
dirpsi = -1,-1,-1,-1 ! Direction of integration
/

&INIT_ACTIVE
l_diffusion = .FALSE. ! Apply Stochastic diffusion along particle trajectories
Ah = 0 ! Horizontal diffusivity coefficient
Av = 0 ! Vertical diffusivity coefficient

/
Loading