Compiling with TS_MPDATA and I4DVAR... Dsrc not found?

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
lmp4
Posts: 38
Joined: Tue Aug 12, 2014 8:32 pm
Location: Imperial College London

Compiling with TS_MPDATA and I4DVAR... Dsrc not found?

#1 Unread post by lmp4 »

I came across this issue a few months ago and I've decided that I should try and see if anyone else has ever come across it. For my data assimilation (DA) application the original model (without the DA enabled) with the TS_MPDATA scheme performs better than other TS schemes.

The problem then seems to arise when using both TS_MPDATA & I4DVAR whereby I get the following compilation error;

Code: Select all

ROMS/Bin/cpp_clean /scratch/lp2314/ROMS/ROMS_TEST/WC13/I4DVAR/Build_I4DVAR_V2/ad_step3d_t.f                                     90
cd /scratch/lp2314/ROMS/ROMS_TEST/WC13/I4DVAR/Build_I4DVAR_V2; /apps/mpt/mpt-2.06/bin/mpif9                                     0 -c -heap-arrays -fp-model precise -ip -O3 ad_step3d_t.f90
ad_step3d_t.f90(672): error #6404: This name does not have a type, and must have an explici                                     t type.   [DSRC]
              ELSE IF (INT(Dsrc(is)).eq.1) THEN
---------------------------^
ad_step3d_t.f90(672): error #6362: The data types of the argument(s) are invalid.   [INT]
              ELSE IF (INT(Dsrc(is)).eq.1) THEN
---------------------------^
compilation aborted for ad_step3d_t.f90 (code 1)
Now if I switch to using TS_U3HADVECTION and TS_C4VADVECTION it compiles fine...

I understand there isn't an adjoint for the TS_MPDATA option so I am also using TS_U3HADVECTION_TL & TS_C4HADVECTION_TL.

Dscr is the source direction for rivers right? I'm not too experianced in the ROMS code so I'm really stuck to why I can't use TS_MPDATA.

Any thoughts would be greatly appreciated! I have attached my .h file for reference of my CPP options.
Attachments
angola_3km_4dvar.h
(25.15 KiB) Downloaded 355 times

User avatar
arango
Site Admin
Posts: 1368
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Compiling with TS_MPDATA and I4DVAR... Dsrc not found?

#2 Unread post by arango »

The option TS_MPDATA is not adjointed. It is highly nonlinear. You can still use the TS_MPDATA for the forward nonlinear model and any other option for the adjoint and tangent linear models. In cppdefs.h, we have:

Code: Select all

**   The flags below are optional. By default, the same options chosen       **
**   for the nonlinear model are selected for the tangent linear,            **
**   representer, and adjoint models.                                        **
**                                                                           **
** TS_A4HADVECTION_TL  use if 4th-order Akima horizontal advection           **
** TS_C2HADVECTION_TL  use if 2nd-order centered horizontal advection        **
** TS_C4HADVECTION_TL  use if 4th-order centered horizontal advection        **
** TS_U3HADVECTION_TL  use if 3rd-order upstream horiz. advection            **
**                                                                           **
** TS_A4VADVECTION_TL  use if 4th-order Akima vertical advection             **
** TS_C2VADVECTION_TL  use if 2nd-order centered vertical advection          **
** TS_C4VADVECTION_TL  use if 4th-order centered vertical advection          **
** TS_SVADVECTION_TL   use if splines vertical advection                     **
We usually pick TS_U3HADVECTION_TL and TS_U3HADVECTION_TL for tracers when using the adjoint, tangent, and representer models. After all, we linearized the codes. The important thing is that the linearized operators are symmetric.

lmp4
Posts: 38
Joined: Tue Aug 12, 2014 8:32 pm
Location: Imperial College London

Re: Compiling with TS_MPDATA and I4DVAR... Dsrc not found?

#3 Unread post by lmp4 »

I am indeed using the cpp settings TS_U3HADVECTION_TL & TS_C4HADVECTION_TL and thus only using TS_MPDATA for the forward model.

My CPP settings are;

Code: Select all

#define TS_MPDATA       /* Recursive MPDATA 3D advection turn ON */ 
#define TS_U3HADVECTION_TL    /* 3rd-order upstream horiz. advection turn tangent linear ON */
#define TS_C4VADVECTION_TL    /* 4th-order centered vertical advection tangent linear turn ON */
I did have another thought though, when looking into ad_step3d_t.f90 I was wondering if

Code: Select all

 ELSE IF (INT(Dsrc(is)).eq.1) THEN 
was actually meant to be

Code: Select all

 ELSE IF (INT(SOURCES(ng)%Dsrc(is)).eq.1) THEN 
?

In any case I tried it but it then failed compiling at -larpack with the following error;

Code: Select all

/scratch/lp2314/ROMS/ROMS_TEST/WC13/I4DVAR/Build_I4DVAR_V3/libADM.a(ad_step3d_t.o): In function `ad_step3d_t_mod_mp_ad_step3d_t_tile_':
ad_step3d_t.f90:(.text+0xb99d): undefined reference to `exchange_r3d_tile_'
ad_step3d_t.f90:(.text+0xbbd4): undefined reference to `mp_exchange4d_'
ad_step3d_t.f90:(.text+0x10df9): undefined reference to `mpdata_adiff_tile_'
ad_step3d_t.f90:(.text+0x16eb5): undefined reference to `ad_mpdata_adiff_tile_'
/scratch/lp2314/ROMS/ROMS_TEST/WC13/I4DVAR/Build_I4DVAR_V3/libTLM.a(tl_step3d_t.o): In function `tl_step3d_t_mod_mp_tl_step3d_t_tile_':
tl_step3d_t.f90:(.text+0x8976): undefined reference to `tl_mpdata_adiff_tile_'
make: *** [/scratch/lp2314/ROMS/ROMS_TEST/WC13/I4DVAR/oceanM] Error 1
I am wondering if my TS_U3HADVECTION_TL & TS_C4VADVECTION_TL are not activating correctly and I am still trying to use TS_MPDATA for the adjoint?

lmp4
Posts: 38
Joined: Tue Aug 12, 2014 8:32 pm
Location: Imperial College London

Re: Compiling with TS_MPDATA and I4DVAR... Dsrc not found?

#4 Unread post by lmp4 »

Still not getting anywhere with this! TS_MPDATA for the forward model really does perform much better :?

Post Reply