PRINCIPES DE PALM MP
Download
Report
Transcript PRINCIPES DE PALM MP
Step-by-step use of OASIS 3.0
Sophie Valcke
PRISM Workshop
KOWI, Brussels
February 26-27, 2003
Slide 1
Step-by-step use of OASIS 3.0
With special thanks to:
Arnaud Caubel (Fujitsu-fecit)
Reiner Vogelsang (Silicon Graphics GmbH)
Veronika Gayler (MPI, M&D)
Damien Declat (CERFACS)
Slide 2
Step-by-step use of OASIS 3.0
Outline
1. Historic, overview, community
2. Model interfacing: PSMILe V.0
3. Sequence and lag concepts - Coupling algorithms
4. Oasis configuration file namcouple
•
•
•
•
Key notes
General parameters
I/O-coupling field general description
Field transformations
5. Auxiliary data files (grids, restarts, transformations)
6. Conclusions and perspectives
Slide 3
Step-by-step use of OASIS 3.0
1. Historic, overview, community
1.1 Historic
1.2 Overview
1.3 Community
Slide 4
Step-by-step use of OASIS 3.0
1. Historic, overview, community
1.1 Historic
1991: Need analysis
1993: Oasis 1.0: Pipe CRAY and ASCII files
1995: Oasis 2.0: Global rewriting + CLIM/PVM3
1996: Oasis 2.1: Used for 100-year climate change simulation
1998: Oasis 2.2: SVIPC communication
1999: Oasis 2.3: GMEM (NEC) communication
2000: Oasis 2.4: MPI2 communication
2002: Oasis 2.4.1: MPI1 communication
2003: Oasis 3.0: PRISM System Model Interface Library
Slide 5
Step-by-step use of OASIS 3.0
1. Historic, overview, community
1.2 Overview
1 monoprocess coupler:
- synchronisation of component models
- exchange of coupling fields
- interpolation of coupling fields
O
A
A
O
OASIS
O
A
O
Sequential or concurrent coupling
Arbitrary number of (parallel) models and coupling fields
Different coupling frequencies for the different fields
Particular transformations for each field
Static coupling: all coupling parameters are fixed initially by
the user in an input file namcouple
Slide 6
Step-by-step use of OASIS 3.0
1. Historic, overview, community
1.3 Community
Regular users:
• CERFACS
• METEO-FRANCE (France)
• IPSL- LODYC, LMD, LSCE
(France)
• ECMWF (UK)
• UCL (Belgium)
• MPI - M&D (Germany)
• SMHI (Sweden)
• BMRC (Australia)
• IRI (USA)
…and :
•AWI (Germany)
•PIK (Germany)
•Met Office (UK)
•UGAMP (UK)
•KNMI (Netherlands)
•CSIRO (Australia)
•FSU/COAPS (USA)
•LASG (China)
•JAMSTEC (Japan)
•…?
Slide 7
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.1 Initialisation
2.2 Partition definition (5)
2.3 I/O-coupling field declaration (3)
2.4 End of definition phase
2.5 I/O-coupling field sending (2)
2.6 I/O-coupling field reception
2.7 Termination
Slide 8
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.1 Initialisation
All processes initialise the coupling and retrieve a local
communicator for internal parallelisation
• USE mod_prism_proto
• CALL prism_init_comp_proto (compid, model_name, ierror)
– compid [INTEGER; OUT]: component model ID.
– model_name [CHARACTER*6; IN]: name of calling model.
– ierror [INTEGER; OUT]: error code.
If model calls MPI_Init, it must be before calling prism_init_comp_proto
• CALL prism_get_localcomm_proto (local_comm, ierror ):
– local_comm [INTEGER; OUT]: local communicator.
– ierror [INTEGER; OUT]: error code.
Slide 9
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.2 Partition definition (1/5)
Each process implied in the coupling defines its local partition in
the global index space.
• CALL prism_def_partition_proto (il_part_id, ig_paral,
ierror):
– il_part_id [INTEGER; OUT]: partition ID.
– ig_paral [INTEGER, DIMENSION(:), IN]: vector of integers
describing the local partition in the global index space.
– ierror [INTEGER; OUT]: error code.
Slide 10
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.2 Partition definition (2/5)
• CALL prism_def_partition_proto (…, ig_paral, …):
* Monoprocess model:
– ig_paral(1) = 0
– ig_paral(2) = 0
– ig_paral(3) = total grid size
See oasis/toymodel/toyclim/Oce/Src/oce.F90
Slide 11
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.2 Partition definition (3/5)
• CALL prism_def_partition_proto (…, ig_paral, …):
* Parallel model with APPLE decomposition:
– ig_paral(1) = 1
– ig_paral(2) = local offset
– ig_paral(3) = local partition size
See oasis/toymodel/toyclim/Atm/Src/decomp_def.F90
Proc 1:
local offset = 0
local size = 4
Proc 2:
local offset = 4
local size = 6
Proc 3:
local offset = 10
local size = 5
Slide 12
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.2 Partition definition (4/5)
• CALL prism_def_partition_proto (…, ig_paral, …):
* Parallel model with BOX decomposition:
ig_paral(1) = 2
ig_paral(4) = local y extent
ig_paral(2) = local offset
ig_paral(5) = global x extent
ig_paral(3) = local x extent
See oasis/toymodel/toyclim/Atm/Src/decomp_def.F90
global x
extent = 5
Proc 1:
local offset = 0
local x extent = 2
local y extent = 2
Proc 2:
local offset = 2
local x extent = 3
local y extent = 2
Proc 3:
local offset = 10
local x extent = 5
local y extent = 1
Slide 13
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.2 Partition definition (5/5)
• CALL prism_def_partition_proto (…, ig_paral, …):
* Parallel model with ORANGE decomposition:
ig_paral(1) = 3
ig_paral(5) = 2nd segment offset
ig_paral(2) = nbr of segments
ig_paral(6) = 2nd segment size
ig_paral(3) = 1st segment offset …
ig_paral(4) = 1st segment size
See oasis/toymodel/toyclim/Atm/Src/decomp_def.F90
Proc 1:
nbr of segments = 3
1st segment offset = 0
1st segment size = 4
2nd segment offset = 7
2nd segment size = 2
3rd segment offset = 10
3rd segment size = 3
Slide 14
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.3 I/O-coupling field declaration (1/3)
Each process implied in the coupling declares the fields it will
send or receive during the simulation
• CALL prism_def_var_proto(var_id, name, il_part_id,
var_nodims, kinout, …)
– var_in [INTEGER; OUT]: coupling field ID
– Name [CHARACTER*8; IN]: field symbolic name
– il_part_id [INTEGER; IN]: partition ID
– var_nodims [INTEGER, DIMENSION(2); IN]:
• var_nodims(1): rank of field array (1 or 2).
• var_nodims(2): number of bundles (always 1, not used for now).
– kinout [INTEGER; IN]: 'PRISM_In', or 'PRISM_Out'.
…
Slide 15
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.3 I/O-coupling field declaration (2/3)
• CALL prism_def_var_proto(…, var_actual_shape,
var_type, ierror)
…
– var_actual_shape [INTEGER, DIMENSION (:); IN]:
minimum and maximum index for each field array
dimension (i.e. 1 and dimension extent)
– var_type [INTEGER; IN]:
type of coupling field array,‘PRISM_Real’ or
‘PRISM_Double’
– ierror [INTEGER; OUT]: error code.
Slide 16
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.3 I/O-coupling field declaration (3/3)
• CALL prism_def_var_proto(…, var_type, …)
Recommendation (PRISM coding rules):
– USE mod_kinds_model
– REAL(kind=ip_realwp_p), dimension(:) :: field_array
– CALL prism_def_var_proto(…, ‘PRISM_Real’, …)
• By default,
ip_realwp_p = kind(SELECTED_REAL_KIND(12,307)) .
• With cpp key use_realtype_single,
ip_realwp_p = kind(SELECTED_REAL_KIND(6,37)) .
Slide 17
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.4 End of definition phase
Each process implied in the coupling closes the definition phase
• CALL prism_enddef_proto(ierror)
– ierror [INTEGER; OUT]: error code
Slide 18
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.5 I/O-coupling field sending (1/2)
In the model time stepping loop, each process implied in the
coupling sends its part of the I/O-coupling field
• USE mod_ prism_put_proto
• CALL prism_put_proto(var_id, date, field_array, ierror)
– var_id [INTEGER; IN]: coupling field ID (prism_def_var_proto)
– date [INTEGER; IN]: number of seconds in the run at the
beginning of the timestep (not final PSMILe date format)
– field_array [REAL, IN] : I/O-coupling field array
– ierror [INTEGER; OUT]: returned error code.
Slide 19
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.5 I/O-coupling field sending (2/2)
• CALL prism_put_proto(var_id, date, field_array, ierror)
– May be called at each model timestep; 'date' automatically
analysed and sending performed only at appropriate time,
given the user-defined period in namcouple.
– User-defined local time transformation indicated in
namcouple (INSTANT, AVERAGE, ACCUMUL, T_MIN or
T_MAX) automatically performed and resulting field sent at
appropriate time.
– Coupling restart file automatically written by last
prism_put_proto called in the run.
Slide 20
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.6 I/O-coupling field reception
In the model time stepping loop, each process implied in the coupling
receivess its part of the I/O-coupling field
• USE mod_ prism_get_proto
• CALL prism_get_proto(var_id, date, field_array, ierror)
– var_id [INTEGER; IN]: coupling field ID (prism_def_var_proto)
– date [INTEGER; IN]: number of seconds in the run at the
beginning of the timestep (not final PSMILe date format)
– field_array [REAL, OUT] : I/O-coupling field array
– ierror [INTEGER; OUT]: returned error code.
May be called at each model timestep; 'date' automatically analysed
and reception performed only at appropriate times, given the userdefined period in namcouple.
Slide 21
Step-by-step use of OASIS 3.0
2. Model interfacing: PSMILe V.0
2.7 Termination
• CALL prism_terminate_proto(ierror)
– ierror [INTEGER; OUT]: returned error code.
If model called MPI_Init, the model must also call MPI_Finalize, but only
after calling prism_terminate_proto.
Slide 22
Step-by-step use of OASIS 3.0
3. Sequence and lag concepts - Coupling algorithms
3.1 Lag concept
3.2 Sequence concept
3.3 Mix of sequence and lag
Slide 23
Step-by-step use of OASIS 3.0
3. Sequence and lag concepts - Coupling algorithms
3.1 Lag concept – 1st example
Timestep = 8
Cpl period(F1) = 24
Cpl period(F2) = 24
Lag(F1) = 8
Lag(F2) = 8
writing to or reading from restart files
sending or reception activated
sending or reception not activated
To prevent deadlocks, F1 and F2 produced at previous timestep are used
Slide 24
Step-by-step use of OASIS 3.0
3. Sequence and lag concepts - Coupling algorithms
3.1 Lag concept – 2nd example
Timestep = 8
Cpl period(F1) = 24
Lag(F1) = 0
Cpl period(F2) = 24
Lag(F2) = 8
Cpl period(F3) = 24
Lag(F3) = 8
To prevent deadlocks, F2 and F3 produced at previous timestep are used
Slide 25
Step-by-step use of OASIS 3.0
3. Sequence and lag concepts - Coupling algorithms
3.2 Sequence concept – 1st example
Timestep = 8
Cpl period(F1) = 24
Cpl period(F2) = 24
Cpl period(F2) = 24
Cpl period(F2) = 24
Seq(F1) = 1
Seq(F2) = 2
Seq(F3) = 3
Seq(F4) = 4
Lag(F1) = 0
Lag(F2) = 0
Lag(F2) = 0
Lag(F2) = 0
Slide 26
Step-by-step use of OASIS 3.0
3. Sequence and lag concepts - Coupling algorithms
3.3 Mix of sequence and lag – sequential model example
Timestep = 8
Cpl period(F1) = 24
Cpl period(F2) = 24
Seq(F1)=1
Seq(F2)=2
Lag(F1) = 8
Lag(F2) = -16
Slide 27
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.1 Key notes on namcouple
4.2 Namcouple : general parameters (3)
4.3 Namcouple: I/O-coupling field general
description (8)
4.4 Namcouple: field transformations (10)
Slide 28
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.1 Key notes on namcouple
• Text file containing all user’s defined information configuring
the coupled run.
• First section describes general coupling parameters and
process management information
• Second section describes the coupling fields, their coupling
period, and the user’s defined transformations/interpolations
• Number of blanks between two character strings nonsignificant
• Lines beginning with # considered as comments
• Blank lines not allowed !!!
Slide 29
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.2 Namcouple : general parameters (1/3)
$SEQMODE
# Maximum number of fields that have to be, at one particular
# coupling time, exchanged sequentially in a given order.
1
$CHANNEL
# Communication technique (MPI1, MPI2, NONE, SIPC, GMEM).
# For MPI1 and MPI2, one additional line per model giving the total number
# of processes, the number of processes implied in the coupling,
# and possibly launching arguments (MPI2).
MPI2
3
1 arg1
1
1 arg2
3
1 arg3
$NFIELDS
# Total number of fields described in namcouple
10
Slide 30
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.2 Namcouple: general parameters (2/3)
$JOBNAME
# Acronym for the run.
RUN
$NBMODEL
# Number of models running + their symbolic names (6 characters)
3 toyatm toyoce toyche
$RUNTIME
# Total duration of run in seconds
518400
$INIDATE
# Initial date of run (YYYYMMDD)
00010101
Slide 31
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.2 Namcouple: general parameters (3/3)
$MODINFO
# Indicates if a header is included with the fields in the binary restart files,
# (and with the exchanged fields for PIPE, SIPC and GMEM): YES or NO.
NO
$NLOGPRT
# Verbose level in Oasis log file cplout: 0,1, or 2.
2
$CALTYPE
# Calendar type : 0 = 365 day calendar (no leap years)
#
1 = leap year calendar
#
n (>1) = n day month calendar
1
$STRINGS
# Begins the I/O-coupling field section
Slide 32
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.3 Namcouple: I/O-coupling field general description (1/8)
4.3.1 EXPORTED and AUXILARY fields (MPI1,MPI2, NONE, SIPC,GMEM) (1/3)
The field is received, treated by Oasis:
for EXPORTED, it is sent to target model;
for AUXILARY, it is combined to an other field.
SOSSTSST SISUTESU 1 86400 5 fldo1.nc out01.nc EXPORTED
182 152 96 48 topa at31 LAG=+14400 SEQ=+1
P 2 P 0
# SOSSTSST: Name in source model prism_def_var_proto – 8 characters max
# SISUTESU: Name in target model prism_def_var_proto – 8 characters max
# 1: Oasis internal label (see driver/src/inipar.f)
# 86400: coupling period (in seconds)
# 5: Number of transformations performed by (PSMILe and) Oasis
Slide 33
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.3 Namcouple: I/O-coupling field general description (2/8)
4.3.1 EXPORTED and AUXILARY fields (MPI1,MPI2, NONE, SIPC,GMEM) (2/3)
SOSSTSST SISUTESU 1 86400 5 fldo1.nc out01.nc EXPORTED
182 152 96 48 topa at31 LAG=+14400 SEQ=+1
P 2 P 0
# ...
# fldo1.nc: Coupling restart file – 8 characters max
#
binary or NetCDF format –> all restart files for one run must be of same type
# out01.nc: Output file (needed for NONE only)
# EXPORTED: Field status (EXPORTED or AUXILARY)
# 182 152: X and Y dimensions of source grid (optional if restart file is NetCDF)
# 96 48: X and Y dimensions of target grid (optional if restart file is NetCDF)
# topa at31: source & target grid prefix (4 characters; used in grid auxiliary files)
Slide 34
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.3 Namcouple: I/O-coupling field general description (3/8)
4.3.1 EXPORTED and AUXILARY fields (MPI1,MPI2, NONE, SIPC,GMEM) (3/3)
SOSSTSST SISUTESU 1 86400 5 fldo1.nc EXPORTED
182 152 96 48 topa at31 LAG=+14400 SEQ=+1
P 2 P 0
#…
# LAG=+14400: the number of seconds to add to a prism_put_proto date to equal
#
the date of a prism_get_proto that should be matched (see 3.1) –optional
# SEQ=+1: position of the field in the sequence of exchange at one particular
# coupling time (see 3.2) -required only if $SEQMODE > 1
# P 2 P 0: source and target grid type (P for periodical, R for regional) and
#
number of overlapping grid points in X
Slide 35
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.3 Namcouple: I/O-coupling field general description (4/8)
4.3.2 EXPOUT fields (MPI1,MPI2 only – PSMILe V.0)
The field is treated as an EXPORTED field.
It is also written at each coupling period to two output files:
one by the source model PSMILe below the prism_put_proto, and
one by the target model PSMILe below the prism_get_proto
SOSSTSST SISUTESU 1 86400 5 fldo1.nc EXPOUT
182 152 96 48 topa at31 LAG=+14400 SEQ=+1
P 2 P 0
# Descriptive lines as for EXPORTED field.
Slide 36
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.3 Namcouple: I/O-coupling field general description (5/8)
4.3.3 IGNORED or IGNOUT fields (MPI1,MPI2 only – PSMILe V.0) (1/2)
The field is exchanged directly by the PSMILe between two models
having the same grid and the same partitioning.
For IGNOUT, the field is also written at each coupling period to two output files:
one by the source model PSMILe below the prism_put_proto, and
one by the target model PSMILe below the prism_get_proto
COSENHFL SOSENHFL 37 86400 1 flda3.nc IGNORED
LAG=+3600 SEQ=+1
# COSENHFL: Name in source model prism_def_var_proto – 8 characters max
# SOSENHFL: Name in target model prism_def_var_proto – 8 characters max
# 37: Oasis internal label (see driver/src/inipar.f)
Slide 37
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.3 Namcouple: I/O-coupling field general description (6/8)
4.3.3 IGNORED or IGNOUT fields (MPI1,MPI2 only – PSMILe V.0) (2/2)
COSENHFL SOSENHFL 37 86400 1 flda3.nc IGNORED
LAG=+3600 SEQ=+1
# 86400: Coupling period (in seconds).
# 1: Number of transformations performed by PSMILe (0, or 1 –>LOCTRANS)
# flda3.nc: Coupling restart file (binary or NetCDF) - 8 characters max
# IGNORED: Field status, IGNORED or IGNOUT
# LAG=+3600: number of seconds to add to the date of a prism_put_proto to
# equal the date of a prism_get_proto that should be matched (see 3.1) –optional
# SEQ=+1: position of the field in the sequence of exchange at one particular
# coupling time (see 3.2) -required only if $SEQMODE > 1
Slide 38
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.3 Namcouple: I/O-coupling field general description (7/8)
4.3.4 INPUT fields (MPI1,MPI2 only – PSMILe V.0)
The field is automatically read by the target model PSMILe at appropriate input
times corresponding to the input period.
SOALBEDO SOALBEDO 17 86400 0 SOALBEDO.nc INPUT
# SOALBEDO: Name in target model prism_def_var_proto – 8 characters max
# 17: Oasis internal label (see driver/src/inipar.f)
# 86400: Input period (in seconds)
# 0: Number of transformations (always 0)
# SOALBEDO.nc: NetCDF input file – 8 characters max. The time variable
# in the input file has to be in seconds since beginning of run.
# INPUT: Field status
Slide 39
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.3 Namcouple: I/O-coupling field general description (8/8)
4.3.5 OUTPUT fields (MPI1,MPI2 only – PSMILe V.0)
The field is automatically written by the source model PSMILe at appropriate
output times corresponding to the output period. The name of the output file
(one per field) is automatically built based on the field name and initial date of
the run ($INIDATE)
TOTOTOTO TOTOTOTO 99 86400 1 OUTPUT
# TOTOTOTO: Name in source model prism_def_var_proto – 8 characters max
# 99: Oasis internal label (see driver/src/inipar.f)
# 86400: Output period (in seconds)
# 1: Number of transformations (0, or 1 –>LOCTRANS)
# OUTPUT: Field status
Slide 40
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.4 Namcouple: field transformations (1/10)
SOSSTSST SISUTESU 1 86400 5 fldo1.nc out01.nc EXPORTED
182 152 96 48 topa at31 LAG=+14400 SEQ=+1
P 2 P 0
LOCTRANS CHECKIN MOZAIC CHECKOUT REVERSE
Input line for LOCTRANS
Input line for CHECKIN
…
Slide 41
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.4 Namcouple: field transformations (2/10)
4.4.1Pre-processing
• LOCTRANS: new! MPI1,MPI2 only – PSMILe V: Time
transformation, automatically performed by prism_put_proto.
One input line giving the transformation on the field transferred:
– INSTANT: no time transformation; instantaneous field;
– ACCUMUL: accumulation over the previous coupling period
– AVERAGE: average over the previous coupling period;
– T_MIN: minimum value for each source grid point over the
previous coupling period;
– T_MAX: maximum value for each source grid point over the
previous coupling period.
Slide 42
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.4 Namcouple: field transformations (3/10)
4.4.1Pre-processing
• REDGLO: interpolates from a reduced grid to a global one.
Should not be used as interpolations now exist for reduced grids.
•
•
•
•
MASK: assigns a given value to masked points (for EXTRAP).
EXTRAP: extrapolates the field over masked points values
INVERT: reorders the field.
CHECKIN: calculates statistics on field before interpolation.
New input line to compute or not field integrals: ‘INT=1’ or ‘INT=0’.
• CORRECT: uses external data to modify the input field.
• BLASOLD: linear combination of the field with any other field
Slide 43
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.4 Namcouple: field transformations (4/10)
4.4.2 Interpolation (1/5)
Types of grids supported have been extended:
• Types 'A', 'B', 'G', 'L', 'Z', and 'Y‘, all ‘lat-lon’ grids still supported.
• Type 'U' now for unstructured grid*.
• New type 'D' for Gaussian reduced atmospheric grids*.
• New type 'LR' for logically-rectangular grids, i.e. that can be
described in the (i,j) space (e.g. stretched and rotated grids). Note
that 'A', 'B', 'G', 'L', 'Z', and 'Y' are particular cases of 'LR' grids.
*All related grid arrays must be 2D and dimensioned (nbr_pts, 1),
where nbr_pts is the total number of grid points.
Slide 44
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.4 Namcouple: field transformations (5/10)
4.4.2 Interpolation (2/5)
• REDGLO: interpolates from a reduced grid to a global one.
Should not be used as interpolations now exist for reduced grids
• INTERP: performs the interpolation per se.
– BILINEAR: bilinear interpolation*
– BICUBIC: bicubic interpolation *
– NNEIBOR: nearest-neighbour interpolation*
– SURFMESH: conservative remapping -fine to coarse grid*
* Source grid must be ‘lat-lon’ ('A', 'B', 'G', 'L', 'Z', or 'Y‘)
– GAUSSIAN: nearest-neighbor with a gaussian weight function
Slide 45
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.4 Namcouple: field transformations (6/10)
4.4.2 Interpolation (3/5)
• SCRIPR: new! Uses Los Alamos National Laboratory SCRIP 1.4
See oasis/CHANGES.html for corresponding namcouple input lines
Linking with NetCDF library is mandatory
– DISTWGT: N nearest-neighbour -‘LR’, ‘D’, or ‘U’ source grid.
– GAUSWGT: N nearest-neighbour with a gaussian weight
function – ‘LR’, ‘D’, or ‘U’ source grid.
– BILINEAR: bilinear interpolation – ‘LR’, or ‘D’ source grid.
– BICUBIC: bilinear interpolation – ‘LR’, or ‘D’ source grid.
– …
Slide 46
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.4 Namcouple: field transformations (7/10)
4.4.2 Interpolation (4/5)
• SCRIPR: new! Uses Los Alamos National Laboratory SCRIP 1.4
– CONSERV: 1st or 2nd order conservative remapping
• Weight for source cell is proportional to area intersected by target cell
• 1st order: 'LR', 'D' and 'U‘ grid, or only 'LR‘ grid if grid corners are not
given in grids.nc and have to be automatically calculated by Oasis
• 2nd order: only 'LR' because of the gradient calculation (not fully tested)
• Different normalization options:
– FRACAREA: sum of source cell intersected areas is used =>no
local flux conservation, but flux value is reasonable
– DESTAREA: target cell area is used => local conservation of flux,
but flux value may be unreasonable
– FRACNNEI: as for FRACAREA, + nearest source neighbour used
for target meshes not intersecting any unmasked source meshes.
Slide 47
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.4 Namcouple: field transformations (8/10)
4.4.2 Interpolation (5/5)
• MOZAIC: maps the field from a source to a target grid with a
grid-mapping file built by the user.
• SUBGRID: maps the input field from a coarse grid to a fine grid
with a grid-mapping file built by the user and recreates subgrid
variability with one of the following operation :
– SOLAR: F1out = [(1- F2out ) / (1- F2in ) ] F1in
– NONSOLAR: F1out = F1in + (dF1in / dF2in) (F2out – F2in)
• NOINTERP: has to be chosen for identical source and target grids.
Slide 48
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.4 Namcouple: field transformations (9/10)
4.4.3 Cooking stage
• CONSERV: modifies the output flux to redistribute uniformly the
difference between the integral flux on the source grid and the one
on target grid, to ensure flux conservation.
• BLASNEW: performs a linear combination of the output field
with any other output field after the interpolation per se.
Slide 49
Step-by-step use of OASIS 3.0
4. Oasis configuration file namcouple
4.4 Namcouple: field transformations (10/10)
4.4.4 Post-processing
• MASKP: new! masks the fields after interpolation (same generic
input line as analysis MASK)
• REVERSE: reorders the field after interpolation.
• CHECKOUT: calculates statistics on field after interpolation.
• GLORED: interpolates from a global Gaussian grid to a reduced
grid. If present, must be the last analysis performed.
Slide 50
Step-by-step use of OASIS 3.0
5. Auxiliary data files
5.1 Auxiliary grid data files
5.1.1 Auxiliary grid data file for longitudes and latitudes
5.1.2 Auxiliary grid data file for masks
5.1.3 Auxiliary grid data file for areas
5.2 Auxiliary coupling restart files
5.3 Auxiliary transformation data files
Slide 51
Step-by-step use of OASIS 3.0
5. Auxiliary data files
5.1Auxiliary grid data files
New! NetCDF format now supported (and recommended !)
5.1.1 Auxiliary grid data file for longitudes and latitudes
• Binary format (grid), or NetCDF format (grids.nc)
• Contains model grid point longitudes and latitudes:
– 2D real arrays (nx, ny), except for ‘U’ and ‘D’ (nbr_pts,1)
– Array name = grid prefix (cf namcouple) + suffix (‘_lon’, ‘_lat’, cf
mod_label.F90)
• May contains longitudes and latitudes for model mesh corners
(SCRIPR/CONSERV):
– 3D real arrays (nx, ny, 4), except for ‘U’ and ‘D’ (nbr_pts,1, 4)
– Array name = grid prefix (cf namcouple)
+ suffix (‘_clo’, ‘_cla’, cf mod_label.F90)
• Mandatory; no need to follow any convention (e.g. W to E, S to N)
but must be coherent with coupling fields.
Slide 52
Step-by-step use of OASIS 3.0
5. Auxiliary data files
5.1 Auxiliary grid data files
5.1.2 Auxiliary grid data file for masks
• Binary format (masks) or NetCDF format (masks.nc); if NetCDF
format is used for grids.nc, mask data files must be NetCDF too.
• Contains model grid point mask :
– 2D integer arrays (nx, ny), except for ‘U’ and ‘D’ (nbr_pts,1)
– Array name = grid prefix (cf namcouple)
+ suffix (‘_msk’, cf mod_label.F90)
– Convention: 0 = not masked, 1= masked.
• Mandatory; no need to follow any convention (e.g. W to E, S to N)
but must be coherent with coupling fields.
• Reduced ‘D’ grid masks should not be given in maskr anymore as
REDGLO and GLORED should be used anymore.
Slide 53
Step-by-step use of OASIS 3.0
5. Auxiliary data files
5.1 Auxiliary grid data files
5.1.3 Auxiliary grid data file for areas
• Binary format (areas) or NetCDF format (areas.nc); if NetCDF
format is used for grids.nc, area data files must be NetCDF too.
• Contains model mesh surfaces:
– 2D real arrays (nx, ny), except for ‘U’ and ‘D’ (nbr_pts,1)
– Array name = grid prefix (cf namcouple)
+ suffix (‘_srf’, cf mod_label.F90)
– Any units (in m2 for statistics calculations in
INTERP/GAUSSIAN)
• Mandatory for 'CHECKIN', 'CHECKOUT' or 'CONSERV'; optional for
INTERP/GAUSSIAN.
Slide 54
Step-by-step use of OASIS 3.0
5. Auxiliary data files
5.2 Auxiliary coupling restart files
New! NetCDF format now supported (and recommended !)
• Binary or NetCDF format; all restart files must use same format.
• Restart file name: any name (except IGNORED,EXPOUT,
IGNOUT, INPUT or OUTPUT) - 8 characters max.
• One or many files per model.
• Contains the restart coupling fields:
– 2D real arrays (nx, ny), except for ‘U’ and ‘D’ (nbr_pts,1)
– Array name = source model field name (cf namcouple)
– Convention: 0 = not masked, 1= masked.
• Mandatory for field for which LAG = 0 and SEQ = 1;
• No need to follow any convention (e.g. W to E, S to N) but must
be coherent with auxiliary grid data files.
Slide 55
Step-by-step use of OASIS 3.0
5. Auxiliary data files
5.3 Auxiliary transformation data files
• As in Oasis 2.4.
• SCRIP will automatically create its own NetCDF auxiliary files
containing interpolation neighbour addresses and weights.
Slide 56
Step-by-step use of OASIS 3.0
6. Conclusions and perspectives
• PRISM helped improve Oasis a lot!
• Oasis 3.0 beta available, please ask me…
• Further developments:
– Parallelisation with OpenMP
– Grid memory management: removal of grid duplications
– In PSMILe V.0, an additional primitive to explicitly write the
coupling restart file (prism_put_restart) ?
– Inclusion of a date in coupling restart files
– Proper vector interpolation for source grid covering a pole
Slide 57