Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Showing
with 124 additions and 242 deletions
......@@ -173,4 +173,3 @@ CONTAINS
!!======================================================================
END MODULE bdy_oce
......@@ -47,7 +47,7 @@ CONTAINS
!!----------------------------------------------------------------------
INTEGER , INTENT(in) :: kt ! Main time step counter
INTEGER , INTENT(in) :: Kbb, Kaa ! Ocean time level indices
REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
LOGICAL, OPTIONAL , INTENT(in) :: dyn3d_only ! T => only update baroclinic velocities
!
INTEGER :: jk, ii, ij, ib_bdy, ib, igrd ! Loop counter
......
......@@ -46,7 +46,7 @@ CONTAINS
REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pua2d, pva2d
REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: pub2d, pvb2d
REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: phur, phvr
REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: pssh
REAL(dp), DIMENSION(jpi,jpj), INTENT(in ) :: pssh
!!
INTEGER :: ib_bdy, ir ! BDY set index, rim index
INTEGER, DIMENSION(3) :: idir3
......@@ -183,7 +183,8 @@ CONTAINS
TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data
INTEGER, INTENT(in) :: ib_bdy ! BDY set index
REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pua2d, pva2d
REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pssh, phur, phvr
REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: phur, phvr
REAL(dp), DIMENSION(jpi,jpj), INTENT(in) :: pssh
LOGICAL , INTENT(in) :: llrim0 ! indicate if rim 0 is treated
INTEGER :: ibeg, iend ! length of rim to be treated (rim 0 or rim 1)
INTEGER :: jb, igrd ! dummy loop indices
......@@ -312,7 +313,7 @@ CONTAINS
!! ** Purpose : Duplicate sea level across open boundaries
!!
!!----------------------------------------------------------------------
REAL(wp), DIMENSION(jpi,jpj,1), INTENT(inout) :: zssh ! Sea level, need 3 dimensions to be used by bdy_nmn
REAL(dp), DIMENSION(jpi,jpj,1), INTENT(inout) :: zssh ! Sea level, need 3 dimensions to be used by bdy_nmn
!!
INTEGER :: ib_bdy, ir ! bdy index, rim index
INTEGER :: ibeg, iend ! length of rim to be treated (rim 0 or rim 1)
......@@ -332,7 +333,7 @@ CONTAINS
END DO
IF( nn_hls > 1 .AND. ir == 1 ) CYCLE ! at least 2 halos will be corrected -> no need to correct rim 1 before rim 0
IF( ANY(llsend1) .OR. ANY(llrecv1) ) THEN ! if need to send/recv in at least one direction
CALL lbc_lnk( 'bdydyn2d', zssh(:,:,1), 'T', 1.0_wp, kfillmode=jpfillnothing ,lsend=llsend1, lrecv=llrecv1 )
CALL lbc_lnk( 'bdydyn2d', zssh(:,:,1), 'T', 1.0_dp, kfillmode=jpfillnothing ,lsend=llsend1, lrecv=llrecv1 )
END IF
END DO
!
......@@ -340,4 +341,3 @@ CONTAINS
!!======================================================================
END MODULE bdydyn2d
......@@ -41,7 +41,7 @@ CONTAINS
!!----------------------------------------------------------------------
INTEGER , INTENT( in ) :: kt ! Main time step counter
INTEGER , INTENT( in ) :: Kbb, Kaa ! Time level indices
REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
!
INTEGER :: ib_bdy, ir ! BDY set index, rim index
INTEGER, DIMENSION(6) :: idir6
......@@ -101,10 +101,10 @@ CONTAINS
END DO
!
IF( ANY(llsend2) .OR. ANY(llrecv2) ) THEN ! if need to send/recv in at least one direction
CALL lbc_lnk( 'bdydyn2d', puu(:,:,:,Kaa), 'U', -1.0_wp, kfillmode=jpfillnothing ,lsend=llsend2, lrecv=llrecv2 )
CALL lbc_lnk( 'bdydyn2d', puu(:,:,:,Kaa), 'U', -1.0_dp, kfillmode=jpfillnothing ,lsend=llsend2, lrecv=llrecv2 )
END IF
IF( ANY(llsend3) .OR. ANY(llrecv3) ) THEN ! if need to send/recv in at least one direction
CALL lbc_lnk( 'bdydyn2d', pvv(:,:,:,Kaa), 'V', -1.0_wp, kfillmode=jpfillnothing ,lsend=llsend3, lrecv=llrecv3 )
CALL lbc_lnk( 'bdydyn2d', pvv(:,:,:,Kaa), 'V', -1.0_dp, kfillmode=jpfillnothing ,lsend=llsend3, lrecv=llrecv3 )
END IF
END DO ! ir
!
......@@ -120,7 +120,7 @@ CONTAINS
!!
!!----------------------------------------------------------------------
INTEGER , INTENT( in ) :: Kaa ! Time level index
REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
TYPE(OBC_INDEX) , INTENT( in ) :: idx ! OBC indices
TYPE(OBC_DATA) , INTENT( in ) :: dta ! OBC external data
INTEGER , INTENT( in ) :: kt ! Time step
......@@ -159,7 +159,7 @@ CONTAINS
!!
!!----------------------------------------------------------------------
INTEGER , INTENT( in ) :: Kaa ! Time level index
REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
TYPE(OBC_INDEX) , INTENT( in ) :: idx ! OBC indices
TYPE(OBC_DATA) , INTENT( in ) :: dta ! OBC external data
INTEGER , INTENT( in ) :: kt
......@@ -224,7 +224,7 @@ CONTAINS
!!----------------------------------------------------------------------
INTEGER , INTENT( in ) :: kt ! time step index
INTEGER , INTENT( in ) :: Kaa ! Time level index
REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
TYPE(OBC_INDEX) , INTENT( in ) :: idx ! OBC indices
TYPE(OBC_DATA) , INTENT( in ) :: dta ! OBC external data
INTEGER , INTENT( in ) :: ib_bdy ! BDY set index
......@@ -267,7 +267,7 @@ CONTAINS
!!----------------------------------------------------------------------
INTEGER , INTENT( in ) :: kt ! time step index
INTEGER , INTENT( in ) :: Kaa ! Time level index
REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
TYPE(OBC_INDEX) , INTENT( in ) :: idx ! OBC indices
TYPE(OBC_DATA) , INTENT( in ) :: dta ! OBC external data
INTEGER , INTENT( in ) :: ib_bdy ! BDY set index
......@@ -311,7 +311,7 @@ CONTAINS
!! References: Marchesiello, McWilliams and Shchepetkin, Ocean Modelling vol. 3 (2001)
!!----------------------------------------------------------------------
INTEGER , INTENT( in ) :: Kbb, Kaa ! Time level indices
REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
TYPE(OBC_INDEX) , INTENT( in ) :: idx ! OBC indices
TYPE(OBC_DATA) , INTENT( in ) :: dta ! OBC external data
INTEGER , INTENT( in ) :: ib_bdy ! BDY set index
......@@ -343,7 +343,7 @@ CONTAINS
!!----------------------------------------------------------------------
INTEGER , INTENT( in ) :: kt ! time step
INTEGER , INTENT( in ) :: Kbb, Krhs ! Time level indices
REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities and trends (to be updated at open boundaries)
REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities and trends (to be updated at open boundaries)
!
INTEGER :: jb, jk ! dummy loop indices
INTEGER :: ib_bdy ! loop index
......@@ -395,7 +395,7 @@ CONTAINS
!!
!!----------------------------------------------------------------------
INTEGER , INTENT( in ) :: Kaa ! Time level index
REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT( inout ) :: puu, pvv ! Ocean velocities (to be updated at open boundaries)
TYPE(OBC_INDEX) , INTENT( in ) :: idx ! OBC indices
INTEGER , INTENT( in ) :: ib_bdy ! BDY set index
LOGICAL , INTENT( in ) :: llrim0 ! indicate if rim 0 is treated
......
......@@ -95,6 +95,7 @@ CONTAINS
rn_time_dmp_out(2:jp_bdy) = rn_time_dmp_out(1)
cn_ice (2:jp_bdy) = cn_ice (1)
nn_ice_dta (2:jp_bdy) = nn_ice_dta (1)
nn_rimwidth (2:jp_bdy) = nn_rimwidth (1)
READ ( numnam_cfg, nambdy, IOSTAT = ios, ERR = 902 )
902 IF( ios > 0 ) CALL ctl_nam ( ios , 'nambdy in configuration namelist' )
IF(lwm) WRITE ( numond, nambdy )
......
......@@ -44,7 +44,7 @@ CONTAINS
!!----------------------------------------------------------------------
TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices
REAL(wp), DIMENSION(:,:), POINTER, INTENT(in) :: dta ! OBC external data
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phia ! tracer trend
REAL(dp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phia ! tracer trend
!!
REAL(wp) :: zwgt ! boundary weight
INTEGER :: ib, ik, igrd ! dummy loop indices
......@@ -73,7 +73,7 @@ CONTAINS
!!----------------------------------------------------------------------
TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices
REAL(wp), DIMENSION(:,:), POINTER, INTENT(in) :: dta ! OBC external data
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phia ! tracer trend
REAL(dp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phia ! tracer trend
!!
INTEGER :: ib, ik, igrd ! dummy loop indices
INTEGER :: ii, ij ! 2D addresses
......@@ -101,8 +101,8 @@ CONTAINS
!!----------------------------------------------------------------------
TYPE(OBC_INDEX), INTENT(in ) :: idx ! OBC indices
REAL(wp), DIMENSION(:,:), POINTER, INTENT(in ) :: dta ! OBC external data
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phib ! before tracer field
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phia ! tracer trend
REAL(dp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phib ! before tracer field
REAL(dp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: phia ! tracer trend
LOGICAL , INTENT(in ) :: lrim0 ! indicate if rim 0 is treated
LOGICAL , INTENT(in ) :: ll_npo ! switch for NPO version
!!
......@@ -145,14 +145,14 @@ CONTAINS
REAL(wp) :: zmask_x, zmask_y1, zmask_y2
REAL(wp) :: zex1, zex2, zey, zey1, zey2
REAL(wp) :: zdt, zdx, zdy, znor2, zrx, zry ! intermediate calculations
REAL(wp) :: zout, zwgt, zdy_centred
REAL(dp) :: zout, zwgt, zdy_centred
REAL(wp) :: zdy_1, zdy_2, zsign_ups
REAL(wp), PARAMETER :: zepsilon = 1.e-30 ! local small value
REAL(wp), POINTER, DIMENSION(:,:) :: zmask ! land/sea mask for field
REAL(wp), POINTER, DIMENSION(:,:) :: zmask_xdif ! land/sea mask for x-derivatives
REAL(wp), POINTER, DIMENSION(:,:) :: zmask_ydif ! land/sea mask for y-derivatives
REAL(wp), POINTER, DIMENSION(:,:) :: pe_xdif ! scale factors for x-derivatives
REAL(wp), POINTER, DIMENSION(:,:) :: pe_ydif ! scale factors for y-derivatives
REAL(dp), POINTER, DIMENSION(:,:) :: pe_xdif ! scale factors for x-derivatives
REAL(dp), POINTER, DIMENSION(:,:) :: pe_ydif ! scale factors for y-derivatives
!!----------------------------------------------------------------------
!
! ----------------------------------!
......@@ -291,8 +291,8 @@ CONTAINS
!!----------------------------------------------------------------------
TYPE(OBC_INDEX), INTENT(in ) :: idx ! BDY indices
INTEGER , INTENT(in ) :: igrd ! grid index
REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: phib ! model before 3D field
REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: phia ! model after 3D field (to be updated)
REAL(dp), DIMENSION(:,:,:), INTENT(in ) :: phib ! model before 3D field
REAL(dp), DIMENSION(:,:,:), INTENT(inout) :: phia ! model after 3D field (to be updated)
REAL(wp), DIMENSION(:,: ), POINTER, INTENT(in ) :: phi_ext ! external forcing data
LOGICAL , INTENT(in ) :: lrim0 ! indicate if rim 0 is treated
LOGICAL , INTENT(in ) :: ll_npo ! switch for NPO version
......@@ -307,14 +307,14 @@ CONTAINS
REAL(wp) :: zmask_x, zmask_y1, zmask_y2
REAL(wp) :: zex1, zex2, zey, zey1, zey2
REAL(wp) :: zdt, zdx, zdy, znor2, zrx, zry ! intermediate calculations
REAL(wp) :: zout, zwgt, zdy_centred
REAL(dp) :: zout, zwgt, zdy_centred
REAL(wp) :: zdy_1, zdy_2, zsign_ups
REAL(wp), PARAMETER :: zepsilon = 1.e-30 ! local small value
REAL(wp), POINTER, DIMENSION(:,:,:) :: zmask ! land/sea mask for field
REAL(wp), POINTER, DIMENSION(:,:,:) :: zmask_xdif ! land/sea mask for x-derivatives
REAL(wp), POINTER, DIMENSION(:,:,:) :: zmask_ydif ! land/sea mask for y-derivatives
REAL(wp), POINTER, DIMENSION(:,:) :: pe_xdif ! scale factors for x-derivatives
REAL(wp), POINTER, DIMENSION(:,:) :: pe_ydif ! scale factors for y-derivatives
REAL(dp), POINTER, DIMENSION(:,:) :: pe_xdif ! scale factors for x-derivatives
REAL(dp), POINTER, DIMENSION(:,:) :: pe_ydif ! scale factors for y-derivatives
!!----------------------------------------------------------------------
!
! ----------------------------------!
......@@ -457,7 +457,7 @@ CONTAINS
!! ! o
!!----------------------------------------------------------------------
INTEGER, INTENT(in ) :: igrd ! grid index
REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: phia ! model after 3D field (to be updated), must be masked
REAL(dp), DIMENSION(:,:,:), INTENT(inout) :: phia ! model after 3D field (to be updated), must be masked
TYPE(OBC_INDEX), INTENT(in ) :: idx ! OBC indices
LOGICAL , INTENT(in ) :: lrim0 ! indicate if rim 0 is treated
!!
......
......@@ -474,4 +474,3 @@ CONTAINS
!!======================================================================
END MODULE bdytides
......@@ -49,7 +49,7 @@ CONTAINS
!!----------------------------------------------------------------------
INTEGER , INTENT(in) :: kt ! Main time step counter
INTEGER , INTENT(in) :: Kbb, Kaa ! time level indices
REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts ! tracer fields
REAL(dp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts ! tracer fields
!
INTEGER :: ib_bdy, jn, igrd, ir ! Loop indeces
TYPE(ztrabdy), DIMENSION(jpts) :: zdta ! Temporary data structure
......@@ -100,7 +100,7 @@ CONTAINS
END SELECT
END DO
IF( ANY(llsend1) .OR. ANY(llrecv1) ) THEN ! if need to send/recv in at least one direction
CALL lbc_lnk( 'bdytra', pts(:,:,:,jn,Kaa), 'T', 1.0_wp, kfillmode=jpfillnothing ,lsend=llsend1, lrecv=llrecv1 )
CALL lbc_lnk( 'bdytra', pts(:,:,:,jn,Kaa), 'T', 1.0_dp, kfillmode=jpfillnothing ,lsend=llsend1, lrecv=llrecv1 )
ENDIF
!
END DO ! ir
......@@ -118,7 +118,7 @@ CONTAINS
!!
!!----------------------------------------------------------------------
TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt ! tracer trend
REAL(dp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pt ! tracer trend
INTEGER, INTENT(in) :: jpa ! TRA index
LOGICAL, INTENT(in) :: llrim0 ! indicate if rim 0 is treated
!
......@@ -149,7 +149,7 @@ CONTAINS
!!----------------------------------------------------------------------
INTEGER , INTENT(in) :: kt ! time step
INTEGER , INTENT(in) :: Kbb, Krhs ! time level indices
REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts ! active tracers and RHS of tracer equation
REAL(dp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts ! active tracers and RHS of tracer equation
!
REAL(wp) :: zwgt ! boundary weight
REAL(wp) :: zta, zsa, ztime
......
......@@ -134,8 +134,8 @@ CONTAINS
!!----------------------------------------------------------------------
INTEGER , INTENT(in ) :: kt ! ocean time-step
INTEGER , INTENT(in ) :: Kmm ! time level index
REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT( out) :: pud ! U & V current data
REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT( out) :: pvd ! U & V current data
REAL(dp), DIMENSION(jpi,jpj,jpk) , INTENT( out) :: pud ! U & V current data
REAL(dp), DIMENSION(jpi,jpj,jpk) , INTENT( out) :: pvd ! U & V current data
!
INTEGER :: ji, jj, jk, jl, jkk ! dummy loop indicies
INTEGER :: ik, il0, il1, ii0, ii1, ij0, ij1 ! local integers
......
......@@ -148,11 +148,11 @@ CONTAINS
!!----------------------------------------------------------------------
INTEGER , INTENT(in ) :: kt ! ocean time-step index
INTEGER , INTENT(in ) :: Kbb, Kmm, Krhs ! ocean time level indices
REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: puu, pvv ! ocean velocities and RHS of momentum equation
REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: puu, pvv ! ocean velocities and RHS of momentum equation
!!
INTEGER :: ji, jj, jk ! dummy loop indices
REAL(wp) :: zua, zva ! local scalars
REAL(wp), DIMENSION(jpi,jpj,jpk,2) :: zuv_dta ! Read in data
REAL(dp), DIMENSION(jpi,jpj,jpk,2) :: zuv_dta ! Read in data
!!----------------------------------------------------------------------
!
IF( ln_timing ) CALL timing_start( 'dyn_dmp' )
......
**********************************
On line biogeochemistry coarsening
**********************************
.. todo::
.. contents::
:local:
Presentation
============
A capacity of coarsening physics to force a BGC model coupled to NEMO has been developed.
This capacity allow to run 'online' a BGC model coupled to OCE-SI3 with a lower resolution,
to reduce the CPU cost of the BGC model, while preserving the effective resolution of the dynamics.
A presentation is available [attachment:crs_wiki_1.1.pdf​ here], where the methodology is presented.
What is available and working for now in this version
=====================================================
[To be completed]
Description of the successful validation tests
==============================================
[To be completed]
What is not working yet with on line coarsening of biogeochemistry
==================================================================
[To be completed]
''should include precise explanation on MPI decomposition problems too''
How to set up and use on line biogeochemistry
=============================================
Extract the on line biogeochemistry branch
------------------------------------------
To get the appropriate source code with the on line coarsening of biogeochemistry feature:
.. code-block:: console
$ svn co https://forge.ipsl.jussieu.fr/nemo/browser/NEMO/branches/2018/dev_r5003_MERCATOR6_CRS
How to activate coarsening?
---------------------------
To activate the coarsening, ``key_crs`` should be added to list of CPP keys.
This key will only activate the coarsening of dynamics.
Some parameters are available in the namelist_cfg:
.. code-block:: fortran
! passive tracer coarsened online simulations
!-----------------------------------------------------------------------
nn_factx = 3 ! Reduction factor of x-direction
nn_facty = 3 ! Reduction factor of y-direction
nn_msh_crs = 0 ! create (=1) a mesh file or not (=0)
nn_crs_kz = 3 ! 0, volume-weighted MEAN of KZ
! 1, MAX of KZ
! 2, MIN of KZ
! 3, 10^(MEAN(LOG(KZ))
! 4, MEDIANE of KZ
ln_crs_wn = .false. ! wn coarsened (T) or computed using horizontal divergence ( F )
! !
ln_crs_top = .true. !coarsening online for the bio
/
- Only ``nn_factx = 3`` is available and the coarsening only works for grids with a T-pivot point for
the north-fold lateral boundary condition (ORCA025, ORCA12, ORCA36, ...).
- ``nn_msh_crs = 1`` will activate the generation of the coarsened grid meshmask.
- ``nn_crs_kz`` is the operator to coarsen the vertical mixing coefficient.
- ``ln_crs_wn``
- when ``key_vvl`` is activated, this logical has no effect;
the coarsened vertical velocities are computed using horizontal divergence.
- when ``key_vvl`` is not activated,
- coarsened vertical velocities are computed using horizontal divergence (``ln_crs_wn = .false.``)
- or coarsened vertical velocities are computed with an average operator (``ln_crs_wn = .true.``)
- ``ln_crs_top = .true.``: should be activated to run BCG model in coarsened space;
so only works when ``key_top`` is in the cpp list and eventually ``key_pisces`` or ``key_my_trc``.
Choice of operator to coarsene KZ
---------------------------------
A sensiblity test has been done with an Age tracer to compare the different operators.
The 3 and 4 options seems to provide the best results.
Some results can be found [xxx here]
Example of xml files to output coarsened variables with XIOS
------------------------------------------------------------
In the [attachment:iodef.xml iodef.xml] file, a "nemo" context is defined and
some variable defined in [attachment:file_def.xml file_def.xml] are writted on the ocean-dynamic grid.
To write variables on the coarsened grid, and in particular the passive tracers,
a "nemo_crs" context should be defined in [attachment:iodef.xml iodef.xml] and
the associated variable are listed in [attachment:file_crs_def.xml file_crs_def.xml ].
Passive tracers tracers initial conditions
------------------------------------------
When initial conditions are provided in NetCDF files, the field might be:
- on the coarsened grid
- or they can be on another grid and
interpolated `on-the-fly <http://forge.ipsl.jussieu.fr/nemo/wiki/Users/SetupNewConfiguration/Weight-creator>`_.
Example of namelist for PISCES :
.. code-block:: fortran
!-----------------------------------------------------------------------
&namtrc_dta ! Initialisation from data input file
!-----------------------------------------------------------------------
!
sn_trcdta(1) = 'DIC_REG1' , -12 , 'DIC' , .false. , .true. , 'yearly' , 'reshape_REG1toeORCA075_bilin.nc' , '' , ''
sn_trcdta(2) = 'ALK_REG1' , -12 , 'ALK' , .false. , .true. , 'yearly' , 'reshape_REG1toeORCA075_bilin.nc' , '' , ''
sn_trcdta(3) = 'O2_REG1' , -1 , 'O2' , .true. , .true. , 'yearly' , 'reshape_REG1toeORCA075_bilin.nc' , '' , ''
sn_trcdta(5) = 'PO4_REG1' , -1 , 'PO4' , .true. , .true. , 'yearly' , 'reshape_REG1toeORCA075_bilin.nc' , '' , ''
sn_trcdta(7) = 'Si_REG1' , -1 , 'Si' , .true. , .true. , 'yearly' , 'reshape_REG1toeORCA075_bilin.nc' , '' , ''
sn_trcdta(10) = 'DOC_REG1' , -12 , 'DOC' , .false. , .true. , 'yearly' , 'reshape_REG1toeORCA075_bilin.nc' , '' , ''
sn_trcdta(14) = 'Fe_REG1' , -12 , 'Fe' , .false. , .true. , 'yearly' , 'reshape_REG1toeORCA075_bilin.nc' , '' , ''
sn_trcdta(23) = 'NO3_REG1' , -1 , 'NO3' , .true. , .true. , 'yearly' , 'reshape_REG1toeORCA075_bilin.nc' , '' , ''
rn_trfac(1) = 1.0e-06 ! multiplicative factor
rn_trfac(2) = 1.0e-06 ! - - - -
rn_trfac(3) = 44.6e-06 ! - - - -
rn_trfac(5) = 122.0e-06 ! - - - -
rn_trfac(7) = 1.0e-06 ! - - - -
rn_trfac(10) = 1.0e-06 ! - - - -
rn_trfac(14) = 1.0e-06 ! - - - -
rn_trfac(23) = 7.6e-06 ! - - - -
cn_dir = './' ! root directory for the location of the data files
PISCES forcing files
--------------------
They might be on the coarsened grid.
Perspectives
============
For the future, a few options are on the table to implement coarsening for biogeochemistry in 4.0 and
future releases.
Those will be discussed in Autumn 2018
......@@ -316,4 +316,3 @@ CONTAINS
!!======================================================================
END MODULE crs
......@@ -245,8 +245,8 @@ CONTAINS
!!----------------------------------------------------------------
!!
!! Arguments
REAL(wp), DIMENSION(jpi,jpj) , INTENT(in) :: p_e1 ! Parent grid U,V scale factors (e1)
REAL(wp), DIMENSION(jpi,jpj) , INTENT(in) :: p_e2 ! Parent grid U,V scale factors (e2)
REAL(dp), DIMENSION(jpi,jpj) , INTENT(in) :: p_e1 ! Parent grid U,V scale factors (e1)
REAL(dp), DIMENSION(jpi,jpj) , INTENT(in) :: p_e2 ! Parent grid U,V scale factors (e2)
CHARACTER(len=1) , INTENT(in) :: cd_type ! grid type U,V
REAL(wp), DIMENSION(jpi_crs,jpj_crs), INTENT(out) :: p_e1_crs ! Coarse grid box 2D quantity
......@@ -342,8 +342,8 @@ CONTAINS
!!----------------------------------------------------------------
CHARACTER(len=1), INTENT(in ) :: cd_type ! grid type U,V
REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(in ) :: p_mask ! Parent grid U,V mask
REAL(wp), DIMENSION(jpi,jpj) , INTENT(in ) :: p_e1 ! Parent grid U,V scale factors (e1)
REAL(wp), DIMENSION(jpi,jpj) , INTENT(in ) :: p_e2 ! Parent grid U,V scale factors (e2)
REAL(dp), DIMENSION(jpi,jpj) , INTENT(in ) :: p_e1 ! Parent grid U,V scale factors (e1)
REAL(dp), DIMENSION(jpi,jpj) , INTENT(in ) :: p_e2 ! Parent grid U,V scale factors (e2)
REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(in ) :: p_e3 ! Parent grid vertical level thickness (e3u, e3v)
REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT( out) :: p_fld1_crs ! Coarse grid box 3D quantity
REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT( out) :: p_fld2_crs ! Coarse grid box 3D quantity
......@@ -473,7 +473,7 @@ CONTAINS
CHARACTER(len=3), INTENT(in) :: cd_op ! Operation SUM, MAX or MIN
CHARACTER(len=1), INTENT(in) :: cd_type ! grid type U,V
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: p_mask ! Parent grid T,U,V mask
REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: p_e12 ! Parent grid T,U,V scale factors (e1 or e2)
REAL(dp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: p_e12 ! Parent grid T,U,V scale factors (e1 or e2)
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL :: p_e3 ! Parent grid vertical level thickness (e3u, e3v)
REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(in), OPTIONAL :: p_surf_crs ! Coarse grid area-weighting denominator
REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(in), OPTIONAL :: p_mask_crs ! Coarse grid T,U,V maska
......@@ -1135,7 +1135,7 @@ CONTAINS
CHARACTER(len=3), INTENT(in) :: cd_op ! Operation SUM, MAX or MIN
CHARACTER(len=1), INTENT(in) :: cd_type ! grid type U,V
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: p_mask ! Parent grid T,U,V mask
REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: p_e12 ! Parent grid T,U,V scale factors (e1 or e2)
REAL(dp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: p_e12 ! Parent grid T,U,V scale factors (e1 or e2)
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL :: p_e3 ! Parent grid vertical level thickness (e3u, e3v)
REAL(wp), DIMENSION(jpi_crs,jpj_crs) , INTENT(in), OPTIONAL :: p_surf_crs ! Coarse grid area-weighting denominator
REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(in), OPTIONAL :: p_mask_crs ! Coarse grid T,U,V mask
......@@ -1630,7 +1630,7 @@ CONTAINS
!! Arguments
CHARACTER(len=1), INTENT(in) :: cd_type ! grid type T, W ( U, V, F)
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: p_mask ! Parent grid T mask
REAL(wp), DIMENSION(jpi,jpj) , INTENT(in) :: p_e1, p_e2 ! 2D tracer T or W on parent grid
REAL(dp), DIMENSION(jpi,jpj) , INTENT(in) :: p_e1, p_e2 ! 2D tracer T or W on parent grid
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: p_e3 ! 3D tracer T or W on parent grid
REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(in) :: p_sfc_crs ! Coarse grid box east or north face quantity
REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(inout) :: p_e3_crs ! Coarse grid box east or north face quantity
......
......@@ -201,5 +201,3 @@ CONTAINS
!!======================================================================
END MODULE crsdomwri
......@@ -32,6 +32,7 @@ MODULE crsfld
!! * Substitutions
# include "do_loop_substitute.h90"
# include "single_precision_substitute.h90"
# include "domzgr_substitute.h90"
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
......@@ -116,30 +117,30 @@ CONTAINS
CALL iom_put( "sss" , tsn_crs(:,:,1,jp_sal) ) ! sss
! U-velocity
CALL crs_dom_ope( uu(:,:,:,Kmm), 'SUM', 'U', umask, un_crs, p_e12=e2u, p_e3=ze3u, p_surf_crs=e2e3u_msk, psgn=-1.0_wp )
CALL crs_dom_ope( CASTSP(uu(:,:,:,Kmm)), 'SUM', 'U', umask, un_crs, p_e12=CASTDP(e2u), p_e3=ze3u, p_surf_crs=e2e3u_msk, psgn=-1.0_wp )
!
zt(:,:,:) = 0._wp ; zs(:,:,:) = 0._wp ; zt_crs(:,:,:) = 0._wp ; zs_crs(:,:,:) = 0._wp
DO_3D( 0, 0, 0, 0, 1, jpkm1 )
zt(ji,jj,jk) = uu(ji,jj,jk,Kmm) * 0.5 * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji+1,jj,jk,jp_tem,Kmm) )
zs(ji,jj,jk) = uu(ji,jj,jk,Kmm) * 0.5 * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji+1,jj,jk,jp_sal,Kmm) )
END_3D
CALL crs_dom_ope( zt, 'SUM', 'U', umask, zt_crs, p_e12=e2u, p_e3=ze3u, p_surf_crs=e2e3u_msk, psgn=-1.0_wp )
CALL crs_dom_ope( zs, 'SUM', 'U', umask, zs_crs, p_e12=e2u, p_e3=ze3u, p_surf_crs=e2e3u_msk, psgn=-1.0_wp )
CALL crs_dom_ope( zt, 'SUM', 'U', umask, zt_crs, p_e12=CASTDP(e2u), p_e3=ze3u, p_surf_crs=e2e3u_msk, psgn=-1.0_wp )
CALL crs_dom_ope( zs, 'SUM', 'U', umask, zs_crs, p_e12=CASTDP(e2u), p_e3=ze3u, p_surf_crs=e2e3u_msk, psgn=-1.0_wp )
CALL iom_put( "uoce" , un_crs ) ! i-current
CALL iom_put( "uocet" , zt_crs ) ! uT
CALL iom_put( "uoces" , zs_crs ) ! uS
! V-velocity
CALL crs_dom_ope( vv(:,:,:,Kmm), 'SUM', 'V', vmask, vn_crs, p_e12=e1v, p_e3=ze3v, p_surf_crs=e1e3v_msk, psgn=-1.0_wp )
CALL crs_dom_ope( CASTSP(vv(:,:,:,Kmm)), 'SUM', 'V', vmask, vn_crs, p_e12=CASTDP(e1v), p_e3=ze3v, p_surf_crs=e1e3v_msk, psgn=-1.0_wp )
!
zt(:,:,:) = 0._wp ; zs(:,:,:) = 0._wp ; zt_crs(:,:,:) = 0._wp ; zs_crs(:,:,:) = 0._wp
DO_3D( 0, 0, 0, 0, 1, jpkm1 )
zt(ji,jj,jk) = vv(ji,jj,jk,Kmm) * 0.5 * ( ts(ji,jj,jk,jp_tem,Kmm) + ts(ji,jj+1,jk,jp_tem,Kmm) )
zs(ji,jj,jk) = vv(ji,jj,jk,Kmm) * 0.5 * ( ts(ji,jj,jk,jp_sal,Kmm) + ts(ji,jj+1,jk,jp_sal,Kmm) )
END_3D
CALL crs_dom_ope( zt, 'SUM', 'V', vmask, zt_crs, p_e12=e1v, p_e3=ze3v, p_surf_crs=e1e3v_msk, psgn=-1.0_wp )
CALL crs_dom_ope( zs, 'SUM', 'V', vmask, zs_crs, p_e12=e1v, p_e3=ze3v, p_surf_crs=e1e3v_msk, psgn=-1.0_wp )
CALL crs_dom_ope( zt, 'SUM', 'V', vmask, zt_crs, p_e12=CASTDP(e1v), p_e3=ze3v, p_surf_crs=e1e3v_msk, psgn=-1.0_wp )
CALL crs_dom_ope( zs, 'SUM', 'V', vmask, zs_crs, p_e12=CASTDP(e1v), p_e3=ze3v, p_surf_crs=e1e3v_msk, psgn=-1.0_wp )
CALL iom_put( "voce" , vn_crs ) ! i-current
CALL iom_put( "vocet" , zt_crs ) ! vT
......@@ -210,9 +211,9 @@ CONTAINS
CALL iom_put( "avs", avs_crs ) ! Kz on S
! sbc fields
CALL crs_dom_ope( ssh(:,:,Kmm) , 'VOL', 'T', tmask, sshn_crs , p_e12=e1e2t, p_e3=ze3t , psgn=1.0_wp )
CALL crs_dom_ope( utau , 'SUM', 'U', umask, utau_crs , p_e12=e2u , p_surf_crs=e2u_crs , psgn=1.0_wp )
CALL crs_dom_ope( vtau , 'SUM', 'V', vmask, vtau_crs , p_e12=e1v , p_surf_crs=e1v_crs , psgn=1.0_wp )
CALL crs_dom_ope( CASTSP(ssh(:,:,Kmm)) , 'VOL', 'T', tmask, sshn_crs , p_e12=e1e2t, p_e3=ze3t , psgn=1.0_wp )
CALL crs_dom_ope( utau , 'SUM', 'U', umask, utau_crs , p_e12=CASTDP(e2u) , p_surf_crs=e2u_crs , psgn=1.0_wp )
CALL crs_dom_ope( vtau , 'SUM', 'V', vmask, vtau_crs , p_e12=CASTDP(e1v) , p_surf_crs=e1v_crs , psgn=1.0_wp )
CALL crs_dom_ope( wndm , 'SUM', 'T', tmask, wndm_crs , p_e12=e1e2t, p_surf_crs=e1e2t_crs, psgn=1.0_wp )
CALL crs_dom_ope( rnf , 'MAX', 'T', tmask, rnf_crs , psgn=1.0_wp )
CALL crs_dom_ope( qsr , 'SUM', 'T', tmask, qsr_crs , p_e12=e1e2t, p_surf_crs=e1e2t_crs, psgn=1.0_wp )
......
......@@ -28,6 +28,7 @@ MODULE crsini
PUBLIC crs_init ! called by nemogcm.F90 module
!! * Substitutions
# include "single_precision_substitute.h90"
# include "domzgr_substitute.h90"
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
......@@ -153,8 +154,8 @@ CONTAINS
! 3.c.1 Horizontal scale factors
CALL crs_dom_hgr( e1t, e2t, 'T', e1t_crs, e2t_crs )
CALL crs_dom_hgr( e1u, e2u, 'U', e1u_crs, e2u_crs )
CALL crs_dom_hgr( e1v, e2v, 'V', e1v_crs, e2v_crs )
CALL crs_dom_hgr( e1u, CASTDP(e2u), 'U', e1u_crs, e2u_crs )
CALL crs_dom_hgr( CASTDP(e1v), e2v, 'V', e1v_crs, e2v_crs )
CALL crs_dom_hgr( e1f, e2f, 'F', e1f_crs, e2f_crs )
e1e2t_crs(:,:) = e1t_crs(:,:) * e2t_crs(:,:)
......@@ -183,7 +184,7 @@ CONTAINS
END DO
! 3.d.2 Surfaces
CALL crs_dom_sfc( tmask, 'W', e1e2w_crs, e1e2w_msk, p_e1=e1t, p_e2=e2t )
CALL crs_dom_sfc( tmask, 'W', e1e2w_crs, e1e2w_msk, p_e1=CASTSP(e1t), p_e2=CASTSP(e2t) )
CALL crs_dom_sfc( umask, 'U', e2e3u_crs, e2e3u_msk, p_e2=e2u, p_e3=ze3u )
CALL crs_dom_sfc( vmask, 'V', e1e3v_crs, e1e3v_msk, p_e1=e1v, p_e3=ze3v )
......@@ -193,8 +194,8 @@ CONTAINS
! 3.d.3 Vertical scale factors
!
CALL crs_dom_e3( e1t, e2t, ze3t, e1e2w_crs, 'T', tmask, e3t_crs, e3t_max_crs)
CALL crs_dom_e3( e1u, e2u, ze3u, e2e3u_crs, 'U', umask, e3u_crs, e3u_max_crs)
CALL crs_dom_e3( e1v, e2v, ze3v, e1e3v_crs, 'V', vmask, e3v_crs, e3v_max_crs)
CALL crs_dom_e3( e1u, CASTDP(e2u), ze3u, e2e3u_crs, 'U', umask, e3u_crs, e3u_max_crs)
CALL crs_dom_e3( CASTDP(e1v), e2v, ze3v, e1e3v_crs, 'V', vmask, e3v_crs, e3v_max_crs)
CALL crs_dom_e3( e1t, e2t, ze3w, e1e2w_crs, 'W', tmask, e3w_crs, e3w_max_crs)
! Replace 0 by e3t_0 or e3w_0
......
......@@ -140,7 +140,7 @@ CONTAINS
INTEGER :: ji, jj, jk
INTEGER :: iyear0, nimonth0,iday0 ! start year,imonth,day
LOGICAL :: ll_print = .FALSE. ! =T print and flush numout
REAL(wp) :: zsto, zout, zmax, zjulian, zmdi ! local scalars
REAL(dp) :: zsto, zout, zmax, zjulian, zmdi ! local scalars
INTEGER :: i_steps ! no of timesteps per hour
REAL(wp), DIMENSION(A2D(0) ) :: zw2d, un_dm, vn_dm ! workspace
REAL(wp), DIMENSION(A2D(0),jpk) :: zw3d ! workspace
......
......@@ -38,6 +38,7 @@ MODULE diaar5
!! * Substitutions
# include "do_loop_substitute.h90"
# include "single_precision_substitute.h90"
# include "domzgr_substitute.h90"
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
......@@ -86,7 +87,7 @@ CONTAINS
IF( l_ar5 ) THEN
ALLOCATE( zarea_ssh(jpi,jpj), zbotpres(jpi,jpj), z2d(jpi,jpj) )
ALLOCATE( zrhd(jpi,jpj,jpk) )
ALLOCATE( zrhd(jpi,jpj,jpk), z3d(jpi,jpj,jpk) )
ALLOCATE( ztsn(jpi,jpj,jpk,jpts) )
zarea_ssh(:,:) = e1e2t(:,:) * ssh(:,:,Kmm)
ENDIF
......@@ -117,7 +118,7 @@ CONTAINS
!
IF( iom_use( 'voltot' ) .OR. iom_use( 'sshtot' ) .OR. iom_use( 'sshdyn' ) ) THEN
! ! total volume of liquid seawater
zvolssh = glob_sum( 'diaar5', zarea_ssh(:,:) )
zvolssh =glob_sum( 'diaar5', CASTDP(zarea_ssh(:,:)) )
zvol = vol0 + zvolssh
CALL iom_put( 'voltot', zvol )
......@@ -134,7 +135,7 @@ CONTAINS
DO jk = 1, jpk
zgdept(:,:,jk) = gdept(:,:,jk,Kmm)
END DO
CALL eos( ztsn, zrhd, zgdept) ! now in situ density using initial salinity
CALL eos( CASTDP(ztsn), zrhd, zgdept) ! now in situ density using initial salinity
!
zbotpres(:,:) = 0._wp ! no atmospheric surface pressure, levitating sea-ice
DO jk = 1, jpkm1
......@@ -212,8 +213,8 @@ CONTAINS
END IF
ENDIF
!
ztemp = glob_sum( 'diaar5', ztsn(:,:,1,jp_tem) )
zsal = glob_sum( 'diaar5', ztsn(:,:,1,jp_sal) )
ztemp =glob_sum( 'diaar5', CASTDP(ztsn(:,:,1,jp_tem)) )
zsal =glob_sum( 'diaar5', CASTDP(ztsn(:,:,1,jp_sal)) )
zmass = rho0 * ( zarho + zvol )
!
CALL iom_put( 'masstot', zmass )
......@@ -229,7 +230,7 @@ CONTAINS
ALLOCATE( ztpot(jpi,jpj,jpk) )
ztpot(:,:,jpk) = 0._wp
DO jk = 1, jpkm1
ztpot(:,:,jk) = eos_pt_from_ct( ts(:,:,jk,jp_tem,Kmm), ts(:,:,jk,jp_sal,Kmm) )
ztpot(:,:,jk) =eos_pt_from_ct( CASTSP(ts(:,:,jk,jp_tem,Kmm)), CASTSP(ts(:,:,jk,jp_sal,Kmm)) )
END DO
!
CALL iom_put( 'toce_pot', ztpot(:,:,:) ) ! potential temperature (TEOS-10 case)
......@@ -240,7 +241,7 @@ CONTAINS
DO jk = 1, jpkm1
z2d(:,:) = z2d(:,:) + e1e2t(:,:) * e3t(:,:,jk,Kmm) * ztpot(:,:,jk)
END DO
ztemp = glob_sum( 'diaar5', z2d(:,:) )
ztemp =glob_sum( 'diaar5', CASTDP(z2d(:,:)) )
CALL iom_put( 'temptot_pot', ztemp / zvol )
ENDIF
!
......@@ -294,8 +295,9 @@ CONTAINS
ENDIF
IF( l_ar5 ) THEN
DEALLOCATE( zarea_ssh , zbotpres, z2d )
DEALLOCATE( ztsn )
DEALLOCATE( zarea_ssh, zbotpres, z2d )
DEALLOCATE( z3d )
DEALLOCATE( ztsn )
ENDIF
!
IF( ln_timing ) CALL timing_stop('dia_ar5')
......@@ -388,7 +390,7 @@ CONTAINS
zvol0 (ji,jj) = zvol0 (ji,jj) + zztmp * e1e2t(ji,jj)
thick0(ji,jj) = thick0(ji,jj) + zztmp
END_3D
vol0 = glob_sum( 'diaar5', zvol0 )
vol0 =glob_sum( 'diaar5', CASTDP(zvol0) )
DEALLOCATE( zvol0 )
IF( iom_use( 'sshthster' ) ) THEN
......
......@@ -33,6 +33,7 @@ MODULE diacfl
!! * Substitutions
# include "do_loop_substitute.h90"
# include "single_precision_substitute.h90"
# include "domzgr_substitute.h90"
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
......@@ -87,11 +88,11 @@ CONTAINS
! ! calculate maximum values and locations
llmsk(Nis0:Nie0,Njs0:Nje0,:) = umask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp ! define only the inner domain
CALL mpp_maxloc( 'diacfl', zCu_cfl, llmsk, zCu_max, iloc_u )
CALL mpp_maxloc( 'diacfl', CASTDP(zCu_cfl), llmsk, zCu_max, iloc_u )
llmsk(Nis0:Nie0,Njs0:Nje0,:) = vmask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp ! define only the inner domain
CALL mpp_maxloc( 'diacfl', zCv_cfl, llmsk, zCv_max, iloc_v )
CALL mpp_maxloc( 'diacfl', CASTDP(zCv_cfl), llmsk, zCv_max, iloc_v )
llmsk(Nis0:Nie0,Njs0:Nje0,:) = wmask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp ! define only the inner domain
CALL mpp_maxloc( 'diacfl', zCw_cfl, llmsk, zCw_max, iloc_w )
CALL mpp_maxloc( 'diacfl', CASTDP(zCw_cfl), llmsk, zCw_max, iloc_w )
!
IF( lwp ) THEN ! write out to file
WRITE(numcfl,FMT='(2x,i6,3x,a6,4x,f7.4,1x,i4,1x,i4,1x,i4)') kt, 'Max Cu', zCu_max, iloc_u(1), iloc_u(2), iloc_u(3)
......
......@@ -26,6 +26,7 @@ MODULE diadct
USE dom_oce ! ocean space and time domain
USE phycst ! physical constants
USE in_out_manager ! I/O manager
USE iom
USE daymod ! calendar
USE dianam ! build name of file
USE lib_mpp ! distributed memory computing library
......@@ -42,9 +43,7 @@ MODULE diadct
PUBLIC dia_dct_init ! routine called by nemogcm.F90
! !!** namelist variables **
LOGICAL, PUBLIC :: ln_diadct !: Calculate transport thru a section or not
INTEGER :: nn_dct ! Frequency of computation
INTEGER :: nn_dctwri ! Frequency of output
INTEGER :: nn_secdebug ! Number of the section to debug
INTEGER, PARAMETER :: nb_class_max = 10
......@@ -53,7 +52,6 @@ MODULE diadct
INTEGER, PARAMETER :: nb_type_class = 10
INTEGER, PARAMETER :: nb_3d_vars = 3
INTEGER, PARAMETER :: nb_2d_vars = 2
INTEGER :: nb_sec
TYPE POINT_SECTION
INTEGER :: I,J
......@@ -87,9 +85,15 @@ MODULE diadct
REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: transports_3d
REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: transports_2d
#if defined key_xios
REAL(wp), ALLOCATABLE, DIMENSION(:) :: heat_transport
REAL(wp), ALLOCATABLE, DIMENSION(:) :: salt_transport
REAL(wp), ALLOCATABLE, DIMENSION(:) :: vol_transport
#endif
!! * Substitutions
# include "single_precision_substitute.h90"
# include "domzgr_substitute.h90"
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
......@@ -159,13 +163,14 @@ CONTAINS
!Read section_ijglobal.diadct
CALL readsec
#if ! defined key_xios
!open output file
IF( lwm ) THEN
CALL ctl_opn( numdct_vol, 'volume_transport', 'NEW', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
CALL ctl_opn( numdct_heat, 'heat_transport' , 'NEW', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
CALL ctl_opn( numdct_salt, 'salt_transport' , 'NEW', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
ENDIF
#endif
! Initialise arrays to zero
transports_3d(:,:,:,:)=0.0
transports_2d(:,:,:) =0.0
......@@ -251,7 +256,10 @@ CONTAINS
ENDDO
!Sum on all procs
IF( lk_mpp )THEN
! IF( lk_mpp )THEN
! removed by AV do not know the significance of this test, following test taken from diaprt
#if ! defined key_mpi_off
IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN
ish(1) = nb_sec_max*nb_type_class*nb_class_max
ish2 = (/nb_sec_max,nb_type_class,nb_class_max/)
DO jsec=1,nb_sec ; zsum(jsec,:,:) = secs(jsec)%transport(:,:) ; ENDDO
......@@ -260,11 +268,21 @@ CONTAINS
zsum(:,:,:)= RESHAPE(zwork,ish2)
DO jsec=1,nb_sec ; secs(jsec)%transport(:,:) = zsum(jsec,:,:) ; ENDDO
ENDIF
#endif
!Write the transport
#if defined key_xios
! IF( lwm ) sec_transport(:) = 0
ALLOCATE(heat_transport(nb_sec),salt_transport(nb_sec),vol_transport(nb_sec))
#endif
DO jsec=1,nb_sec
#if defined key_xios
! xios waits for a send from all procs
CALL dia_dct_wri(kt,jsec,secs(jsec))
#else
IF( lwm )CALL dia_dct_wri(kt,jsec,secs(jsec))
#endif
!nullify transports values after writing
transports_3d(:,jsec,:,:)=0.
......@@ -272,6 +290,14 @@ CONTAINS
secs(jsec)%transport(:,:)=0.
ENDDO
#if defined key_xios
IF ( .NOT. l_istiled .OR. ntile == nijtile ) THEN
CALL iom_put('mfo' , vol_transport )
CALL iom_put('sfo' , salt_transport )
CALL iom_put('hfo' , heat_transport )
ENDIF
DEALLOCATE(heat_transport, salt_transport, vol_transport)
#endif
ENDIF
......@@ -678,13 +704,13 @@ CONTAINS
ztn = interp(Kmm,k%I,k%J,jk,'V',ts(:,:,:,jp_tem,Kmm) )
zsn = interp(Kmm,k%I,k%J,jk,'V',ts(:,:,:,jp_sal,Kmm) )
zrhop = interp(Kmm,k%I,k%J,jk,'V',rhop)
zrhoi = interp(Kmm,k%I,k%J,jk,'V',rhd*rho0+rho0)
zrhoi =interp(Kmm,k%I,k%J,jk,'V',CASTDP(rhd*rho0+rho0))
zsshn = 0.5*( ssh(k%I,k%J,Kmm) + ssh(k%I,k%J+1,Kmm) ) * vmask(k%I,k%J,1)
CASE(2,3)
ztn = interp(Kmm,k%I,k%J,jk,'U',ts(:,:,:,jp_tem,Kmm) )
zsn = interp(Kmm,k%I,k%J,jk,'U',ts(:,:,:,jp_sal,Kmm) )
zrhop = interp(Kmm,k%I,k%J,jk,'U',rhop)
zrhoi = interp(Kmm,k%I,k%J,jk,'U',rhd*rho0+rho0)
zrhoi =interp(Kmm,k%I,k%J,jk,'U',CASTDP(rhd*rho0+rho0))
zsshn = 0.5*( ssh(k%I,k%J,Kmm) + ssh(k%I+1,k%J,Kmm) ) * umask(k%I,k%J,1)
END SELECT
!
......@@ -851,13 +877,13 @@ CONTAINS
ztn = interp(Kmm,k%I,k%J,jk,'V',ts(:,:,:,jp_tem,Kmm) )
zsn = interp(Kmm,k%I,k%J,jk,'V',ts(:,:,:,jp_sal,Kmm) )
zrhop = interp(Kmm,k%I,k%J,jk,'V',rhop)
zrhoi = interp(Kmm,k%I,k%J,jk,'V',rhd*rho0+rho0)
zrhoi =interp(Kmm,k%I,k%J,jk,'V',CASTDP(rhd*rho0+rho0))
CASE(2,3)
ztn = interp(Kmm,k%I,k%J,jk,'U',ts(:,:,:,jp_tem,Kmm) )
zsn = interp(Kmm,k%I,k%J,jk,'U',ts(:,:,:,jp_sal,Kmm) )
zrhop = interp(Kmm,k%I,k%J,jk,'U',rhop)
zrhoi = interp(Kmm,k%I,k%J,jk,'U',rhd*rho0+rho0)
zrhoi =interp(Kmm,k%I,k%J,jk,'U',CASTDP(rhd*rho0+rho0))
zsshn = 0.5*( ssh(k%I,k%J,Kmm) + ssh(k%I+1,k%J,Kmm) ) * umask(k%I,k%J,1)
END SELECT
......@@ -1039,6 +1065,7 @@ CONTAINS
zbnd2 = sec%ztem(jclass+1)
ENDIF
#if ! defined key_xios
!write volume transport per class
WRITE(numdct_vol,118) ndastp,kt,ksec,sec%name,zslope, &
jclass,classe,zbnd1,zbnd2,&
......@@ -1058,9 +1085,16 @@ CONTAINS
sec%transport(5,jclass)*1.e-9,sec%transport(6,jclass)*1.e-9,&
(sec%transport(5,jclass)+sec%transport(6,jclass))*1.e-9
ENDIF
#endif
ENDDO
#if defined key_xios
IF ( .NOT. l_istiled .OR. ntile == nijtile ) THEN
vol_transport(ksec) = zsumclasses(1)+zsumclasses(2)
salt_transport(ksec) = ( zsumclasses(5)+zsumclasses(6) )*1e-9
heat_transport(ksec) = ( zsumclasses(3)+zsumclasses(4) )*1e-15
ENDIF
#else
zbnd1 = 0._wp
zbnd2 = 0._wp
jclass=0
......@@ -1100,7 +1134,7 @@ CONTAINS
118 FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3F12.4)
119 FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3E15.6)
!
#endif
END SUBROUTINE dia_dct_wri
......@@ -1168,7 +1202,7 @@ CONTAINS
INTEGER, INTENT(IN) :: Kmm ! time level index
INTEGER, INTENT(IN) :: ki, kj, kk ! coordinate of point
CHARACTER(len=1), INTENT(IN) :: cd_point ! type of point (U, V)
REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(IN) :: ptab ! variable to compute at (ki, kj, kk )
REAL(dp), DIMENSION(jpi,jpj,jpk), INTENT(IN) :: ptab ! variable to compute at (ki, kj, kk )
REAL(wp) :: interp ! interpolated variable
!*local declations
......