Index: branches/UKMO/dev_r5518_medusa_chg_trc_bio_medusa/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_init.F90
===================================================================
--- branches/UKMO/dev_r5518_medusa_chg_trc_bio_medusa/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_init.F90	(revision 8045)
+++ branches/UKMO/dev_r5518_medusa_chg_trc_bio_medusa/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_init.F90	(revision 8076)
@@ -37,5 +37,4 @@
       USE trc,               ONLY: ln_diatrc, med_diag, nittrc000,     &
                                    trc2d, trc3d
-      USE wrk_nemo,          ONLY: wrk_alloc
 
 # if defined key_iomput
@@ -175,112 +174,112 @@
          IF ( kt == nittrc000 )   CALL trc_nam_iom_medusa 
 
-         CALL wrk_alloc( jpi, jpj,      zw2d )
+         ALLOCATE( zw2d(1:jpi, 1:jpj) )
          zw2d(:,:)      = 0.0   !!
          IF ( med_diag%PRN%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fprn2d    )
+            ALLOCATE( fprn2d(1:jpi, 1:jpj) )
             fprn2d(:,:)      = 0.0 !!
          ENDIF
          IF ( med_diag%MPN%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fdpn2d    )
+            ALLOCATE( fdpn2d(1:jpi, 1:jpj) )
             fdpn2d(:,:)      = 0.0 !!
          ENDIF
          IF ( med_diag%PRD%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fprd2d    )
+            ALLOCATE( fprd2d(1:jpi, 1:jpj) )
             fprd2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%MPD%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fdpd2d    )
+            ALLOCATE( fdpd2d(1:jpi, 1:jpj) )
             fdpd2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OPAL%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fprds2d    )
+            ALLOCATE( fprds2d(1:jpi, 1:jpj) )
             fprds2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OPALDISS%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fsdiss2d    )
+            ALLOCATE( fsdiss2d(1:jpi, 1:jpj) )
             fsdiss2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%GMIPn%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fgmipn2d    )
+            ALLOCATE( fgmipn2d(1:jpi, 1:jpj) )
             fgmipn2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%GMID%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fgmid2d    )
+            ALLOCATE( fgmid2d(1:jpi, 1:jpj) )
             fgmid2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%MZMI%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fdzmi2d    )
+            ALLOCATE( fdzmi2d(1:jpi, 1:jpj) )
             fdzmi2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%GMEPN%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fgmepn2d    )
+            ALLOCATE( fgmepn2d(1:jpi, 1:jpj) )
             fgmepn2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%GMEPD%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fgmepd2d    )
+            ALLOCATE( fgmepd2d(1:jpi, 1:jpj) )
             fgmepd2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%GMEZMI%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fgmezmi2d    )
+            ALLOCATE( fgmezmi2d(1:jpi, 1:jpj) )
             fgmezmi2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%GMED%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fgmed2d    )
+            ALLOCATE( fgmed2d(1:jpi, 1:jpj) )
             fgmed2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%MZME%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fdzme2d    )
+            ALLOCATE( fdzme2d(1:jpi, 1:jpj) )
             fdzme2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%DETN%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fslown2d    )
+            ALLOCATE( fslown2d(1:jpi, 1:jpj) )
             fslown2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%MDET%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fdd2d    )
+            ALLOCATE( fdd2d(1:jpi, 1:jpj) )
             fdd2d(:,:)      = 0.0 !!
          ENDIF      
          IF( med_diag%AEOLIAN%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   ffetop2d    )
+            ALLOCATE( ffetop2d(1:jpi, 1:jpj) )
             ffetop2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%BENTHIC%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    ffebot2d   )
+            ALLOCATE( ffebot2d(1:jpi, 1:jpj) )
             ffebot2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%SCAVENGE%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   ffescav2d    )
+            ALLOCATE( ffescav2d(1:jpi, 1:jpj) )
             ffescav2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%PN_JLIM%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fjln2d    )
+            ALLOCATE( fjln2d(1:jpi, 1:jpj) )
             fjln2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%PN_NLIM%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fnln2d    )
+            ALLOCATE( fnln2d(1:jpi, 1:jpj) )
             fnln2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%PN_FELIM%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   ffln2d    )
+            ALLOCATE( ffln2d(1:jpi, 1:jpj) )
             ffln2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%PD_JLIM%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fjld2d    )
+            ALLOCATE( fjld2d(1:jpi, 1:jpj) )
             fjld2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%PD_NLIM%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fnld2d    )
+            ALLOCATE( fnld2d(1:jpi, 1:jpj) )
             fnld2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%PD_FELIM%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   ffld2d    )
+            ALLOCATE( ffld2d(1:jpi, 1:jpj) )
             ffld2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%PD_SILIM%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fsld2d2    )
+            ALLOCATE( fsld2d2(1:jpi, 1:jpj) )
             fsld2d2(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%PDSILIM2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fsld2d    )
+            ALLOCATE( fsld2d(1:jpi, 1:jpj) )
             fsld2d(:,:)      = 0.0 !!
          ENDIF
@@ -289,9 +288,9 @@
 !!
          IF( med_diag%TOTREG_N%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fregen2d    )
+            ALLOCATE( fregen2d(1:jpi, 1:jpj) )
             fregen2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%TOTRG_SI%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fregensi2d    )
+            ALLOCATE( fregensi2d(1:jpi, 1:jpj) )
             fregensi2d(:,:)      = 0.0 !!
          ENDIF
@@ -300,21 +299,21 @@
 !!
          IF( med_diag%FASTN%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   ftempn2d    )
+            ALLOCATE( ftempn2d(1:jpi, 1:jpj) )
             ftempn2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%FASTSI%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   ftempsi2d    )
+            ALLOCATE( ftempsi2d(1:jpi, 1:jpj) )
             ftempsi2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%FASTFE%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,  ftempfe2d     )
+            ALLOCATE( ftempfe2d(1:jpi, 1:jpj) )
             ftempfe2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%FASTC%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,  ftempc2d     )
+            ALLOCATE( ftempc2d(1:jpi, 1:jpj) )
             ftempc2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%FASTCA%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   ftempca2d    )
+            ALLOCATE( ftempca2d(1:jpi, 1:jpj) )
             ftempca2d(:,:)      = 0.0 !!
          ENDIF     
@@ -323,21 +322,21 @@
 !!
          IF( med_diag%REMINN%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    freminn2d   )
+            ALLOCATE( freminn2d(1:jpi, 1:jpj) )
             freminn2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%REMINSI%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    freminsi2d   )
+            ALLOCATE( freminsi2d(1:jpi, 1:jpj) )
             freminsi2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%REMINFE%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    freminfe2d   )
+            ALLOCATE( freminfe2d(1:jpi, 1:jpj) )
             freminfe2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%REMINC%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   freminc2d    )
+            ALLOCATE( freminc2d(1:jpi, 1:jpj) )
             freminc2d(:,:)      = 0.0 !! 
          ENDIF
          IF( med_diag%REMINCA%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   freminca2d    )
+            ALLOCATE( freminca2d(1:jpi, 1:jpj) )
             freminca2d(:,:)      = 0.0 !!
          ENDIF
@@ -348,10 +347,10 @@
 !!
          IF( med_diag%RR_0100%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    ffastca2d   )
+            ALLOCATE( ffastca2d(1:jpi, 1:jpj) )
             ffastca2d(:,:)      = 0.0 !!
          ENDIF
 
          IF( med_diag%ATM_PCO2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    f_pco2a2d   )
+            ALLOCATE( f_pco2a2d(1:jpi, 1:jpj) )
             f_pco2a2d(:,:)      = 0.0 !!
          ENDIF
@@ -360,5 +359,5 @@
 !!
          IF( med_diag%OCN_PCO2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    f_pco2w2d   )
+            ALLOCATE( f_pco2w2d(1:jpi, 1:jpj) )
             f_pco2w2d(:,:)      = 0.0 !!
          ENDIF
@@ -367,5 +366,5 @@
 !!
          IF( med_diag%CO2FLUX%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   f_co2flux2d    )
+            ALLOCATE( f_co2flux2d(1:jpi, 1:jpj) )
             f_co2flux2d(:,:)      = 0.0 !!
          ENDIF
@@ -374,25 +373,25 @@
 !!
          IF( med_diag%TCO2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   f_TDIC2d    )
+            ALLOCATE( f_TDIC2d(1:jpi, 1:jpj) )
             f_TDIC2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%TALK%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    f_TALK2d   )
+            ALLOCATE( f_TALK2d(1:jpi, 1:jpj) )
             f_TALK2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%KW660%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    f_kw6602d   )
+            ALLOCATE( f_kw6602d(1:jpi, 1:jpj) )
             f_kw6602d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ATM_PP0%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    f_pp02d   )
+            ALLOCATE( f_pp02d(1:jpi, 1:jpj) )
             f_pp02d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%O2FLUX%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   f_o2flux2d    )
+            ALLOCATE( f_o2flux2d(1:jpi, 1:jpj) )
             f_o2flux2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%O2SAT%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    f_o2sat2d   )
+            ALLOCATE( f_o2sat2d(1:jpi, 1:jpj) )
             f_o2sat2d(:,:)      = 0.0 !!
          ENDIF 
@@ -401,9 +400,9 @@
 !! 
          IF( med_diag%SFR_OCAL%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    sfr_ocal2d  )
+            ALLOCATE( sfr_ocal2d(1:jpi, 1:jpj) )
             sfr_ocal2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%SFR_OARG%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    sfr_oarg2d  )
+            ALLOCATE( sfr_oarg2d(1:jpi, 1:jpj) )
             sfr_oarg2d(:,:)      = 0.0 !!
          ENDIF
@@ -412,41 +411,41 @@
 !! 
          IF( med_diag%IBEN_N%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    iben_n2d  )
+            ALLOCATE( iben_n2d(1:jpi, 1:jpj) )
             iben_n2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%IBEN_FE%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   iben_fe2d   )
+            ALLOCATE( iben_fe2d(1:jpi, 1:jpj) )
             iben_fe2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%IBEN_C%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   iben_c2d   )
+            ALLOCATE( iben_c2d(1:jpi, 1:jpj) )
             iben_c2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%IBEN_SI%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   iben_si2d   )
+            ALLOCATE( iben_si2d(1:jpi, 1:jpj) )
             iben_si2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%IBEN_CA%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   iben_ca2d   )
+            ALLOCATE( iben_ca2d(1:jpi, 1:jpj) )
             iben_ca2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OBEN_N%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    oben_n2d  )
+            ALLOCATE( oben_n2d(1:jpi, 1:jpj) )
             oben_n2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OBEN_FE%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    oben_fe2d  )
+            ALLOCATE( oben_fe2d(1:jpi, 1:jpj) )
             oben_fe2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OBEN_C%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    oben_c2d  )
+            ALLOCATE( oben_c2d(1:jpi, 1:jpj) )
             oben_c2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OBEN_SI%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    oben_si2d  )
+            ALLOCATE( oben_si2d(1:jpi, 1:jpj) )
             oben_si2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OBEN_CA%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    oben_ca2d  )
+            ALLOCATE( oben_ca2d(1:jpi, 1:jpj) )
             oben_ca2d(:,:)      = 0.0 !!
          ENDIF
@@ -456,21 +455,21 @@
 
          IF( med_diag%RIV_N%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    rivn2d   )
+            ALLOCATE( rivn2d(1:jpi, 1:jpj) )
             rivn2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%RIV_SI%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    rivsi2d   )
+            ALLOCATE( rivsi2d(1:jpi, 1:jpj) )
             rivsi2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%RIV_C%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   rivc2d    )
+            ALLOCATE( rivc2d(1:jpi, 1:jpj) )
             rivc2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%RIV_ALK%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    rivalk2d   )
+            ALLOCATE( rivalk2d(1:jpi, 1:jpj) )
             rivalk2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%DETC%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    fslowc2d   )
+            ALLOCATE( fslowc2d(1:jpi, 1:jpj) )
             fslowc2d(:,:)      = 0.0 !!
          ENDIF 
@@ -479,5 +478,5 @@
 !!
          IF( med_diag%LYSO_CA%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    lyso_ca2d  )
+            ALLOCATE( lyso_ca2d(1:jpi, 1:jpj) )
             lyso_ca2d(:,:)      = 0.0 !!
          ENDIF
@@ -486,85 +485,85 @@
 !!
          IF( med_diag%PN_LLOSS%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    fdpn22d   )
+            ALLOCATE( fdpn22d(1:jpi, 1:jpj) )
             fdpn22d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%PD_LLOSS%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    fdpd22d   )
+            ALLOCATE( fdpd22d(1:jpi, 1:jpj) )
             fdpd22d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZI_LLOSS%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    fdzmi22d   )
+            ALLOCATE( fdzmi22d(1:jpi, 1:jpj) )
             fdzmi22d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZE_LLOSS%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fdzme22d    )
+            ALLOCATE( fdzme22d(1:jpi, 1:jpj) )
             fdzme22d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZI_MES_N%dgsave ) THEN   
-            CALL wrk_alloc( jpi, jpj,   zimesn2d    )
+            ALLOCATE( zimesn2d(1:jpi, 1:jpj) )
             zimesn2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZI_MES_D%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    zimesd2d   )
+            ALLOCATE( zimesd2d(1:jpi, 1:jpj) )
             zimesd2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZI_MES_C%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    zimesc2d   )
+            ALLOCATE( zimesc2d(1:jpi, 1:jpj) )
             zimesc2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZI_MESDC%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    zimesdc2d   )
+            ALLOCATE( zimesdc2d(1:jpi, 1:jpj) )
             zimesdc2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZI_EXCR%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,     ziexcr2d  )
+            ALLOCATE( ziexcr2d(1:jpi, 1:jpj) )
             ziexcr2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZI_RESP%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    ziresp2d   )
+            ALLOCATE( ziresp2d(1:jpi, 1:jpj) )
             ziresp2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZI_GROW%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    zigrow2d   )
+            ALLOCATE( zigrow2d(1:jpi, 1:jpj) )
             zigrow2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZE_MES_N%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   zemesn2d    )
+            ALLOCATE( zemesn2d(1:jpi, 1:jpj) )
             zemesn2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZE_MES_D%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    zemesd2d   )
+            ALLOCATE( zemesd2d(1:jpi, 1:jpj) )
             zemesd2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZE_MES_C%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    zemesc2d   )
+            ALLOCATE( zemesc2d(1:jpi, 1:jpj) )
             zemesc2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZE_MESDC%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    zemesdc2d   )
+            ALLOCATE( zemesdc2d(1:jpi, 1:jpj) )
             zemesdc2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZE_EXCR%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    zeexcr2d   )
+            ALLOCATE( zeexcr2d(1:jpi, 1:jpj) )
             zeexcr2d(:,:)      = 0.0 !!
          ENDIF                  
          IF( med_diag%ZE_RESP%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    zeresp2d   )
+            ALLOCATE( zeresp2d(1:jpi, 1:jpj) )
             zeresp2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ZE_GROW%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    zegrow2d   )
+            ALLOCATE( zegrow2d(1:jpi, 1:jpj) )
             zegrow2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%MDETC%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   mdetc2d    )
+            ALLOCATE( mdetc2d(1:jpi, 1:jpj) )
             mdetc2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%GMIDC%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    gmidc2d   )
+            ALLOCATE( gmidc2d(1:jpi, 1:jpj) )
             gmidc2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%GMEDC%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,    gmedc2d   )
+            ALLOCATE( gmedc2d(1:jpi, 1:jpj) )
             gmedc2d(:,:)      = 0.0 !!
          ENDIF
@@ -574,21 +573,21 @@
          IF (jdms .eq. 1) THEN
             IF( med_diag%DMS_SURF%dgsave ) THEN
-               CALL wrk_alloc( jpi, jpj,   dms_surf2d    )
+               ALLOCATE( dms_surf2d(1:jpi, 1:jpj) )
                dms_surf2d(:,:)      = 0.0 !!
             ENDIF
             IF( med_diag%DMS_ANDR%dgsave ) THEN
-               CALL wrk_alloc( jpi, jpj,   dms_andr2d    )
+               ALLOCATE( dms_andr2d(1:jpi, 1:jpj) )
                dms_andr2d(:,:)      = 0.0 !!
             ENDIF
             IF( med_diag%DMS_SIMO%dgsave ) THEN
-               CALL wrk_alloc( jpi, jpj,  dms_simo2d     )
+               ALLOCATE( dms_simo2d(1:jpi, 1:jpj) )
                dms_simo2d(:,:)      = 0.0 !!
             ENDIF
             IF( med_diag%DMS_ARAN%dgsave ) THEN
-               CALL wrk_alloc( jpi, jpj,   dms_aran2d    )
+               ALLOCATE( dms_aran2d(1:jpi, 1:jpj) )
                dms_aran2d(:,:)      = 0.0 !!
             ENDIF
             IF( med_diag%DMS_HALL%dgsave ) THEN
-               CALL wrk_alloc( jpi, jpj,   dms_hall2d    )
+               ALLOCATE( dms_hall2d(1:jpi, 1:jpj) )
                dms_hall2d(:,:)      = 0.0 !!
             ENDIF
@@ -597,50 +596,50 @@
          !! AXY (24/11/16): extra MOCSY diagnostics, 2D
          IF( med_diag%ATM_XCO2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, f_xco2a_2d      )
+            ALLOCATE( f_xco2a_2d(1:jpi, 1:jpj) )
             f_xco2a_2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OCN_FCO2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, f_fco2w_2d      )
+            ALLOCATE( f_fco2w_2d(1:jpi, 1:jpj) )
             f_fco2w_2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%ATM_FCO2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, f_fco2a_2d      )
+            ALLOCATE( f_fco2a_2d(1:jpi, 1:jpj) )
             f_fco2a_2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OCN_RHOSW%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, f_ocnrhosw_2d   )
+            ALLOCATE( f_ocnrhosw_2d(1:jpi, 1:jpj) )
             f_ocnrhosw_2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OCN_SCHCO2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, f_ocnschco2_2d  )
+            ALLOCATE( f_ocnschco2_2d(1:jpi, 1:jpj) )
             f_ocnschco2_2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OCN_KWCO2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, f_ocnkwco2_2d   )
+            ALLOCATE( f_ocnkwco2_2d(1:jpi, 1:jpj) )
             f_ocnkwco2_2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OCN_K0%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, f_ocnk0_2d      )
+            ALLOCATE( f_ocnk0_2d(1:jpi, 1:jpj) )
             f_ocnk0_2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%CO2STARAIR%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, f_co2starair_2d )
+            ALLOCATE( f_co2starair_2d(1:jpi, 1:jpj) )
             f_co2starair_2d(:,:)      = 0.0 !!
          ENDIF
          IF( med_diag%OCN_DPCO2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, f_ocndpco2_2d   )
+            ALLOCATE( f_ocndpco2_2d(1:jpi, 1:jpj) )
             f_ocndpco2_2d(:,:)      = 0.0 !!
          ENDIF
 # endif  
          IF( med_diag%TPP3%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk,       tpp3d )
+            ALLOCATE( tpp3d(1:jpi, 1:jpj, 1:jpk) )
             tpp3d(:,:,:)      = 0.0 !! 
          ENDIF
          IF( med_diag%DETFLUX3%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk,        detflux3d )
+            ALLOCATE( detflux3d(1:jpi, 1:jpj, 1:jpk) )
             detflux3d(:,:,:)      = 0.0 !! 
          ENDIF
          IF( med_diag%REMIN3N%dgsave ) THEN
-             CALL wrk_alloc( jpi, jpj, jpk,        remin3dn )
+             ALLOCATE( remin3dn(1:jpi, 1:jpj, 1:jpk) )
              remin3dn(:,:,:)      = 0.0 !! 
          ENDIF
@@ -650,49 +649,49 @@
          !!                   needed for coupling/passed through restart
          !! IF( med_diag%FGCO2%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   fgco2    )
+            ALLOCATE( fgco2(1:jpi, 1:jpj) )
             fgco2(:,:)      = 0.0 !!
          !! ENDIF
          IF( med_diag%INTDISSIC%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   intdissic    )
+            ALLOCATE( intdissic(1:jpi, 1:jpj) )
             intdissic(:,:)  = 0.0 !!
          ENDIF          
          IF( med_diag%INTDISSIN%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   intdissin    )
+            ALLOCATE( intdissin(1:jpi, 1:jpj) )
             intdissin(:,:)  = 0.0 !!
          ENDIF          
          IF( med_diag%INTDISSISI%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   intdissisi    )
+            ALLOCATE( intdissisi(1:jpi, 1:jpj) )
             intdissisi(:,:)  = 0.0 !!
          ENDIF          
          IF( med_diag%INTTALK%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   inttalk    )
+            ALLOCATE( inttalk(1:jpi, 1:jpj) )
             inttalk(:,:)  = 0.0 !!
          ENDIF          
          IF( med_diag%O2min%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   o2min    )
+            ALLOCATE( o2min(1:jpi, 1:jpj) )
             o2min(:,:)  = 1.e3 !! set to high value as we're looking for min(o2)
          ENDIF          
          IF( med_diag%ZO2min%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj,   zo2min    )
+            ALLOCATE( zo2min(1:jpi, 1:jpj) )
             zo2min(:,:)  = 0.0 !!
          ENDIF          
          IF( med_diag%FBDDTALK%dgsave  ) THEN
-            CALL wrk_alloc( jpi, jpj, fbddtalk  )
+            ALLOCATE( fbddtalk(1:jpi, 1:jpj) )
             fbddtalk(:,:)  = 0.0 !! 
          ENDIF
          IF( med_diag%FBDDTDIC%dgsave  ) THEN
-            CALL wrk_alloc( jpi, jpj, fbddtdic  )
+            ALLOCATE( fbddtdic(1:jpi, 1:jpj) )
             fbddtdic(:,:)  = 0.0 !! 
          ENDIF
          IF( med_diag%FBDDTDIFE%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, fbddtdife )
+            ALLOCATE( fbddtdife(1:jpi, 1:jpj) )
             fbddtdife(:,:) = 0.0 !! 
          ENDIF
          IF( med_diag%FBDDTDIN%dgsave  ) THEN
-            CALL wrk_alloc( jpi, jpj, fbddtdin  )
+            ALLOCATE( fbddtdin(1:jpi, 1:jpj) )
             fbddtdin(:,:)  = 0.0 !! 
          ENDIF
          IF( med_diag%FBDDTDISI%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, fbddtdisi )
+            ALLOCATE( fbddtdisi(1:jpi, 1:jpj) )
             fbddtdisi(:,:) = 0.0 !! 
          ENDIF
@@ -700,125 +699,125 @@
          !! AXY (10/11/16): CMIP6 diagnostics, 3D
          IF( med_diag%TPPD3%dgsave     ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, tppd3     )
+            ALLOCATE( tppd3(1:jpi, 1:jpj, 1:jpk) )
             tppd3(:,:,:)     = 0.0 !! 
          ENDIF
          IF( med_diag%BDDTALK3%dgsave  ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, bddtalk3  )
+            ALLOCATE( bddtalk3(1:jpi, 1:jpj, 1:jpk) )
             bddtalk3(:,:,:)  = 0.0 !! 
          ENDIF
          IF( med_diag%BDDTDIC3%dgsave  ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, bddtdic3  )
+            ALLOCATE( bddtdic3(1:jpi, 1:jpj, 1:jpk) )
             bddtdic3(:,:,:)  = 0.0 !! 
          ENDIF
          IF( med_diag%BDDTDIFE3%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, bddtdife3 )
+            ALLOCATE( bddtdife3(1:jpi, 1:jpj, 1:jpk) )
             bddtdife3(:,:,:) = 0.0 !! 
          ENDIF
          IF( med_diag%BDDTDIN3%dgsave  ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, bddtdin3  )
+            ALLOCATE( bddtdin3(1:jpi, 1:jpj, 1:jpk) )
             bddtdin3(:,:,:)  = 0.0 !! 
          ENDIF
          IF( med_diag%BDDTDISI3%dgsave ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, bddtdisi3 )
+            ALLOCATE( bddtdisi3(1:jpi, 1:jpj, 1:jpk) )
             bddtdisi3(:,:,:) = 0.0 !! 
          ENDIF
          IF( med_diag%FD_NIT3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, fd_nit3   )
+            ALLOCATE( fd_nit3(1:jpi, 1:jpj, 1:jpk) )
             fd_nit3(:,:,:)   = 0.0 !! 
          ENDIF
          IF( med_diag%FD_SIL3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, fd_sil3   )
+            ALLOCATE( fd_sil3(1:jpi, 1:jpj, 1:jpk) )
             fd_sil3(:,:,:)   = 0.0 !! 
          ENDIF
          IF( med_diag%FD_CAR3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, fd_car3   )
+            ALLOCATE( fd_car3(1:jpi, 1:jpj, 1:jpk) )
             fd_car3(:,:,:)   = 0.0 !! 
          ENDIF
          IF( med_diag%FD_CAL3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, fd_cal3   )
+            ALLOCATE( fd_cal3(1:jpi, 1:jpj, 1:jpk) )
             fd_cal3(:,:,:)   = 0.0 !! 
          ENDIF
          IF( med_diag%DCALC3%dgsave    ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, dcalc3    )
+            ALLOCATE( dcalc3(1:jpi, 1:jpj, 1:jpk) )
             dcalc3(:,:,: )   = 0.0 !! 
          ENDIF
          IF( med_diag%EXPC3%dgsave     ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, expc3   )
+            ALLOCATE( expc3(1:jpi, 1:jpj, 1:jpk) )
             expc3(:,:,: )    = 0.0 !! 
          ENDIF
          IF( med_diag%EXPN3%dgsave     ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, expn3   )
+            ALLOCATE( expn3(1:jpi, 1:jpj, 1:jpk) )
             expn3(:,:,: )    = 0.0 !! 
          ENDIF
          IF( med_diag%FEDISS3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, fediss3   )
+            ALLOCATE( fediss3(1:jpi, 1:jpj, 1:jpk) )
             fediss3(:,:,: )  = 0.0 !! 
          ENDIF
          IF( med_diag%FESCAV3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, fescav3   )
+            ALLOCATE( fescav3(1:jpi, 1:jpj, 1:jpk) )
             fescav3(:,:,: )  = 0.0 !! 
          ENDIF
          IF( med_diag%MIGRAZP3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, migrazp3  )
+            ALLOCATE( migrazp3(1:jpi, 1:jpj, 1:jpk) )
             migrazp3(:,:,: )  = 0.0 !! 
          ENDIF
          IF( med_diag%MIGRAZD3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, migrazd3  )
+            ALLOCATE( migrazd3(1:jpi, 1:jpj, 1:jpk) )
             migrazd3(:,:,: )  = 0.0 !! 
          ENDIF
          IF( med_diag%MEGRAZP3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, megrazp3  )
+            ALLOCATE( megrazp3(1:jpi, 1:jpj, 1:jpk) )
             megrazp3(:,:,: )  = 0.0 !! 
          ENDIF
          IF( med_diag%MEGRAZD3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, megrazd3  )
+            ALLOCATE( megrazd3(1:jpi, 1:jpj, 1:jpk) )
             megrazd3(:,:,: )  = 0.0 !! 
          ENDIF
          IF( med_diag%MEGRAZZ3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, megrazz3  )
+            ALLOCATE( megrazz3(1:jpi, 1:jpj, 1:jpk) )
             megrazz3(:,:,: )  = 0.0 !! 
          ENDIF
          IF( med_diag%O2SAT3%dgsave     ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, o2sat3    )
+            ALLOCATE( o2sat3(1:jpi, 1:jpj, 1:jpk) )
             o2sat3(:,:,: )    = 0.0 !! 
          ENDIF
          IF( med_diag%PBSI3%dgsave      ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, pbsi3     )
+            ALLOCATE( pbsi3(1:jpi, 1:jpj, 1:jpk) )
             pbsi3(:,:,: )     = 0.0 !! 
          ENDIF
          IF( med_diag%PCAL3%dgsave      ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, pcal3     )
+            ALLOCATE( pcal3(1:jpi, 1:jpj, 1:jpk) )
             pcal3(:,:,: )     = 0.0 !! 
          ENDIF
          IF( med_diag%REMOC3%dgsave     ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, remoc3    )
+            ALLOCATE( remoc3(1:jpi, 1:jpj, 1:jpk) )
             remoc3(:,:,: )    = 0.0 !! 
          ENDIF
          IF( med_diag%PNLIMJ3%dgsave    ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, pnlimj3   )
+            ALLOCATE( pnlimj3(1:jpi, 1:jpj, 1:jpk) )
             pnlimj3(:,:,: )   = 0.0 !! 
          ENDIF
          IF( med_diag%PNLIMN3%dgsave    ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, pnlimn3   )
+            ALLOCATE( pnlimn3(1:jpi, 1:jpj, 1:jpk) )
             pnlimn3(:,:,: )   = 0.0 !! 
          ENDIF
          IF( med_diag%PNLIMFE3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, pnlimfe3  )
+            ALLOCATE( pnlimfe3(1:jpi, 1:jpj, 1:jpk) )
             pnlimfe3(:,:,: )  = 0.0 !! 
          ENDIF
          IF( med_diag%PDLIMJ3%dgsave    ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, pdlimj3   )
+            ALLOCATE( pdlimj3(1:jpi, 1:jpj, 1:jpk) )
             pdlimj3(:,:,: )   = 0.0 !! 
          ENDIF
          IF( med_diag%PDLIMN3%dgsave    ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, pdlimn3   )
+            ALLOCATE( pdlimn3(1:jpi, 1:jpj, 1:jpk) )
             pdlimn3(:,:,: )   = 0.0 !! 
          ENDIF
          IF( med_diag%PDLIMFE3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, pdlimfe3  )
+            ALLOCATE( pdlimfe3(1:jpi, 1:jpj, 1:jpk) )
             pdlimfe3(:,:,: )  = 0.0 !! 
          ENDIF
          IF( med_diag%PDLIMSI3%dgsave   ) THEN
-            CALL wrk_alloc( jpi, jpj, jpk, pdlimsi3  )
+            ALLOCATE( pdlimsi3(1:jpi, 1:jpj, 1:jpk) )
             pdlimsi3(:,:,: )  = 0.0 !! 
          ENDIF
