[MITgcm-devel] pdaf in mitgcm
Jean-Michel Campin
jmc at mit.edu
Wed Jun 14 11:41:00 EDT 2017
Hi Martin,
I think it would be good to have this checked-in.
I did not look too much to the details but the option:
USE_PDAF
would have to be defined in CPP_EEOPTIONS.h I guess ?
Cheers,
Jean-Michel
On Tue, Jun 13, 2017 at 02:52:45PM +0200, Martin Losch wrote:
> Hi all,
> we use a sequential data assimilation framework (PDAF: http://pdaf.awi.de/trac/wiki) with the MITgcm. It requires minimal changes to the code (in eeboot_minimal.F and the_main_loop.F), where PDAF routines are called (currently enclosed with new CPP flag USE_PDAF). PDAF is freely available and Lars (the developer) will post example applications with the MITgcm very soon.
>
> I would like to add our version of eeboot_minimal.F and the_main_loop.F to main repository, so that it is easier to maintain PDAF+MITgcm for use.
>
> Any objections,
>
> Martin
>
> PS. below are the differences to current code (contextual diff):
>
> Index: model/src/the_main_loop.F
> ===================================================================
> RCS file: /u/gcmpack/MITgcm/model/src/the_main_loop.F,v
> retrieving revision 1.181
> diff -u -r1.181 the_main_loop.F
> --- model/src/the_main_loop.F 20 Mar 2017 19:38:16 -0000 1.181
> +++ model/src/the_main_loop.F 13 Jun 2017 12:34:49 -0000
> @@ -1,5 +1,5 @@
> C $Header: /u/gcmpack/MITgcm/model/src/the_main_loop.F,v 1.181 2017/03/20 19:38:16 mmazloff Exp $
> -C $Name: $
> +C $Name: BASE $
>
> #include "PACKAGES_CONFIG.h"
> #include "CPP_OPTIONS.h"
> @@ -340,6 +340,13 @@
> c >>>>>>>>>>>>>>>>>>>>>>>>>>> LOOP <<<<<<<<<<<<<<<<<<<<<<<<<<<<
> c >>>>>>>>>>>>>>>>>>>>>>>>>>> STARTS <<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> +#ifdef USE_PDAF
> +c Initialize PDAF
> + CALL TIMER_START('INIT_PDAF [THE_MAIN_LOOP]', myThid)
> + CALL init_pdaf( nIter0, myTime, myIter, myThid )
> + CALL TIMER_STOP ('INIT_PDAF [THE_MAIN_LOOP]', myThid)
> +#endif
> +
> c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> #ifndef ALLOW_OPENAD
> # ifdef ALLOW_AUTODIFF
> @@ -609,6 +616,13 @@
> CALL MAIN_DO_LOOP( iloop, myTime, myIter, myThid )
> CALL TIMER_STOP ('MAIN_DO_LOOP [THE_MAIN_LOOP]', myThid)
>
> +#ifdef USE_PDAF
> +C PDAF analysis step
> + CALL TIMER_START('ASSIMILATE_PDAF [THE_MAIN_LOOP]', myThid)
> + CALL assimilate_pdaf( myTime, myIter, myThid )
> + CALL TIMER_STOP ('ASSIMILATE_PDAF [THE_MAIN_LOOP]', myThid)
> +#endif
> +
> c-- >>> Loop body end <<<
> #ifndef ALLOW_OPENAD
> # ifdef ALLOW_AUTODIFF
>
> Index: eesupp/src/eeboot_minimal.F
> ===================================================================
> RCS file: /u/gcmpack/MITgcm/eesupp/src/eeboot_minimal.F,v
> retrieving revision 1.29
> diff -u -r1.29 eeboot_minimal.F
> --- eesupp/src/eeboot_minimal.F 28 Jan 2017 18:39:06 -0000 1.29
> +++ eesupp/src/eeboot_minimal.F 13 Jun 2017 12:35:37 -0000
> @@ -1,5 +1,5 @@
> C $Header: /u/gcmpack/MITgcm/eesupp/src/eeboot_minimal.F,v 1.29 2017/01/28 18:39:06 jmc Exp $
> -C $Name: $
> +C $Name: BASE $
>
> #include "PACKAGES_CONFIG.h"
> #include "CPP_EEOPTIONS.h"
> @@ -48,7 +48,11 @@
> C fNam :: Used to build file name for standard and error output.
> C msgBuf :: Used to build messages for printing.
> INTEGER myThid
> +#ifdef USE_PDAF
> + CHARACTER*18 fNam
> +#else
> CHARACTER*13 fNam
> +#endif /* USE_PDAF */
> CHARACTER*(MAX_LEN_MBUF) msgBuf
> #ifdef ALLOW_USE_MPI
> C mpiRC :: Error code reporting variable used with MPI.
> @@ -61,6 +65,9 @@
> #if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
> INTEGER mpiMyWid, color
> #endif
> +#ifdef USE_PDAF
> + INTEGER mpi_task_id
> +#endif /* USE_PDAF */
> #endif /* ALLOW_USE_MPI */
> CEOP
>
> @@ -124,6 +131,13 @@
> ENDIF
>
> doReport = .FALSE.
> +#ifdef USE_PDAF
> +C initialize PDAF
> +C for more output increase second parameter from 1 to 2
> + CALL init_parallel_pdaf(0, 1, MPI_COMM_MODEL, MPI_COMM_MODEL,
> + & mpi_task_id)
> +#endif /* USE_PDAF */
> +
> #ifdef ALLOW_OASIS
> C add a 1rst preliminary call EESET_PARAMS to set useOASIS
> C (needed to decide either to call OASIS_INIT or not)
> @@ -169,7 +183,11 @@
> GOTO 999
> ENDIF
> myProcId = mpiMyId
> +#ifdef USE_PDAF
> + WRITE(myProcessStr,'(I4.4,A1,I4.4)') mpi_task_id,'.',myProcId
> +#else
> WRITE(myProcessStr,'(I4.4)') myProcId
> +#endif /* USE_PDAF */
> mpiPidIo = myProcId
> pidIO = mpiPidIo
> IF ( mpiPidIo .EQ. myProcId ) THEN
> @@ -177,8 +195,14 @@
> IF( myProcId .EQ. 0 ) THEN
> #endif
> WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:4)
> +#ifdef USE_PDAF
> + WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:9)
> +#endif
> OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown')
> WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4)
> +#ifdef USE_PDAF
> + WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:9)
> +#endif
> OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown')
> #ifdef SINGLE_DISK_IO
> ELSE
>
>
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list