New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#1579 (Assumption initial conditions are on z-levels when ln_sco = .true.) – NEMO

Opened 9 years ago

Last modified 4 years ago

#1579 assigned Request

Assumption initial conditions are on z-levels when ln_sco = .true.

Reported by: jamesharle Owned by: jamesharle
Priority: low Milestone:
Component: OCE Version: trunk
Severity: minor Keywords:
Cc:

Description

The initial conditions for runs ln_sco = .true. are assumed to be on z-levels based on gdept_1d. This is not immediately apparent from reading the manual.

A few options would be to either:

  • modify code such that depth information is required in the initial condition file. This would allow an initial condition file, comprising a different number of levels and/or gird type, to be read in and interpolated onto gdept_0.
  • remove the interpolation loop completely (bearing in mind the on-going simplification process) and impose that the initial conditions read in have to be on gdept_0, requiring a pre-processing step.

Commit History (0)

(No commits)

Change History (9)

comment:1 Changed 9 years ago by jamesharle

A fix I used a while back to get me going - could be tidied:

Index: dtatsd.F90
===================================================================
--- dtatsd.F90 (revision 5527)
+++ dtatsd.F90 (working copy)
@@ -22,6 +22,8 @@

USE lib_mpp ! MPP library
USE wrk_nemo ! Memory allocation
USE timing ! Timing

+ USE in_out_manager
+ USE iom

IMPLICIT NONE
PRIVATE

@@ -33,6 +35,9 @@

LOGICAL , PUBLIC
ln_tsd_tradmp !: internal damping toward input data flag
TYPE(FLD), ALLOCATABLE, DIMENSION(:)
sf_tsd ! structure of input SST (file informations, fields read)
+#if defined key_gen_IC
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:,: ) :: gdept_init
+#endif

!! * Substitutions

# include "domzgr_substitute.h90"

@@ -147,6 +152,10 @@

!

INTEGER
ji, jj, jk, jl, jkk ! dummy loop indicies
INTEGER
ik, il0, il1, ii0, ii1, ij0, ij1 ! local integers

+#if defined key_gen_IC
+ INTEGER :: id, jpk_init, jpk_initm1 ! local integers
+ INTEGER , DIMENSION(4) :: ddims
+#endif

REAL(wp)
zl, zi
REAL(wp), POINTER, DIMENSION(:)
ztp, zsp ! 1D workspace !!----------------------------------------------------------------------
@@ -154,6 +163,18 @@

IF( nn_timing == 1 ) CALL timing_start('dta_tsd')
!
CALL fld_read( kt, 1, sf_tsd ) !== read T & S data at kt time step ==!

+
+#if defined key_gen_IC
+ CALL iom_open ( sf_tsd(jp_tem)%clname, sf_tsd(jp_tem)%num )
+ !! get dimensions
+ id = iom_varid( sf_tsd(jp_tem)%num, 'gdept', ddims )
+ jpk_init = ddims(3)
+ IF(lwp) WRITE(numout,*) 'Dimensions of ICs: ', ddims, jpk_init
+ ALLOCATE( gdept_init(jpi,jpj,jpk_init) )
+ CALL iom_get ( sf_tsd(jp_tem)%num, jpdom_data, 'gdept', gdept_init,1)
+ CALL iom_close( sf_tsd(jp_tem)%num ) ! Close the input file
+ jpk_initm1=jpk_init-1
+#endif

!
!
! !== ORCA_R2 configuration and T & S damping ==!

@@ -221,16 +242,30 @@

DO ji = 1, jpi

DO jk = 1, jpk ! determines the intepolated T-S profiles at each (i,j) points

zl = gdept_0(ji,jj,jk)

+#if defined key_gen_IC
+ IF( zl < gdept_init(ji,jj,1 ) ) THEN ! above the first level of data
+#else

IF( zl < gdept_1d(1 ) ) THEN ! above the first level of data

+#endif

ztp(jk) = ptsd(ji,jj,1 ,jp_tem)
zsp(jk) = ptsd(ji,jj,1 ,jp_sal)

+#if defined key_gen_IC
+ ELSEIF( zl > gdept_init(ji,jj,jpk_init) ) THEN ! below the last level of data
+#else

ELSEIF( zl > gdept_1d(jpk) ) THEN ! below the last level of data

+#endif

ztp(jk) = ptsd(ji,jj,jpkm1,jp_tem)
zsp(jk) = ptsd(ji,jj,jpkm1,jp_sal)

ELSE ! inbetween : vertical interpolation between jkk & jkk+1

+#if defined key_gen_IC
+ DO jkk = 1, jpk_initm1 ! when gdept(jkk) < zl < gdept(jkk+1)
+ IF( (zl-gdept_init(ji,jj,jkk)) * (zl-gdept_init(ji,jj,jkk+1)) <= 0._wp ) THEN
+ zi = ( zl - gdept_init(ji,jj,jkk) ) / (gdept_init(ji,jj,jkk+1)-gdept_init(ji,jj,jkk))
+#else

DO jkk = 1, jpkm1 ! when gdept(jkk) < zl < gdept(jkk+1)

IF( (zl-gdept_1d(jkk)) * (zl-gdept_1d(jkk+1)) <= 0._wp ) THEN

zi = ( zl - gdept_1d(jkk) ) / (gdept_1d(jkk+1)-gdept_1d(jkk))

+#endif

ztp(jk) = ptsd(ji,jj,jkk,jp_tem) + ( ptsd(ji,jj,jkk+1,jp_tem) - ptsd(ji,jj,jkk,jp_tem) ) * zi
zsp(jk) = ptsd(ji,jj,jkk,jp_sal) + ( ptsd(ji,jj,jkk+1,jp_sal) - ptsd(ji,jj,jkk,jp_sal) ) * zi

ENDIF

@@ -303,6 +338,9 @@

DEALLOCATE( sf_tsd(jp_sal)%fnow ) ! S arrays in the structure

IF( sf_tsd(jp_sal)%ln_tint ) DEALLOCATE( sf_tsd(jp_sal)%fdta )

DEALLOCATE( sf_tsd ) ! the structure itself

+#if defined key_gen_IC
+ DEALLOCATE( gdept_init )
+#endif

ENDIF
!
IF( nn_timing == 1 ) CALL timing_stop('dta_tsd')

Version 1, edited 9 years ago by jamesharle (previous) (next) (diff)

comment:2 Changed 7 years ago by nicolasmartin

  • Owner nemo deleted
  • Status changed from new to assigned

comment:3 Changed 6 years ago by nicolasmartin

  • Severity set to minor
  • Type changed from Task to Enhancement

comment:4 Changed 6 years ago by jamesharle

I'm currently writing this code into my copy of the trunk. I was also thinking of removing this loop and putting it into domain_cfg TOOLS so the initial conditions are mapped onto the native vertical grid and written out when domain_cfg is used. That way they can be read in a runtime without the need for on-the-fly interpolation.

comment:5 Changed 6 years ago by nicolasmartin

  • Owner set to jamesharle

comment:6 Changed 4 years ago by smasson

  • Owner changed from jamesharle to mathiot

comment:7 Changed 4 years ago by mathiot

  • Owner changed from mathiot to jamesharle

James, one other solution could be to clarify the documentation and if you really want to to implement the capability and an action in the proposal for 2020 WP.

comment:8 Changed 4 years ago by jamesharle

  • Version changed from v3.6 to trunk

OK - I have an updated changeset for v4.0 that I've been using for ORCHESTRA, so won't be too much effort to add. I'll look over the documentation and discuss with Andrew.

comment:9 Changed 4 years ago by clevy

  • Type changed from Enhancement to Feature request
Note: See TracTickets for help on using tickets.