Index: /branches/2012/dev_r3604_LEGI8_TAM/NEMOGCM/NEMO/OPATAM_SRC/TAM/trj_tam.F90
===================================================================
--- /branches/2012/dev_r3604_LEGI8_TAM/NEMOGCM/NEMO/OPATAM_SRC/TAM/trj_tam.F90	(revision 3661)
+++ /branches/2012/dev_r3604_LEGI8_TAM/NEMOGCM/NEMO/OPATAM_SRC/TAM/trj_tam.F90	(revision 3662)
@@ -219,45 +219,45 @@
             CALL iom_open( cl_dirtrj, inumtrj1 )
             if ( inumtrj1 == -1)  CALL ctl_stop( 'No tam_trajectory cl_amstrj found' )
-
-            ALLOCATE( &
-               & empr1(jpi,jpj),  &
-               & empsr1(jpi,jpj), &
-               & empr2(jpi,jpj),  &
-               & empsr2(jpi,jpj), &
-               & bfruar1(jpi,jpj),&
-               & bfrvar1(jpi,jpj),&
-               & bfruar2(jpi,jpj),&
-               & bfrvar2(jpi,jpj) &
-               & )
-
-            ALLOCATE( &
-               & unr1(jpi,jpj,jpk),     &
-               & vnr1(jpi,jpj,jpk),     &
-               & tnr1(jpi,jpj,jpk),     &
-               & snr1(jpi,jpj,jpk),     &
-               & avmur1(jpi,jpj,jpk),   &
-               & avmvr1(jpi,jpj,jpk),   &
-               & avtr1(jpi,jpj,jpk),    &
-               & etot3r1(jpi,jpj,jpk),  &
-               & unr2(jpi,jpj,jpk),     &
-               & vnr2(jpi,jpj,jpk),     &
-               & tnr2(jpi,jpj,jpk),     &
-               & snr2(jpi,jpj,jpk),     &
-               & avmur2(jpi,jpj,jpk),   &
-               & avmvr2(jpi,jpj,jpk),   &
-               & avtr2(jpi,jpj,jpk),    &
-               & etot3r2(jpi,jpj,jpk)   &
-               & )
+            IF ( .NOT. ln_mem ) THEN
+               ALLOCATE( &
+                  & empr1(jpi,jpj),  &
+                  & empsr1(jpi,jpj), &
+                  & empr2(jpi,jpj),  &
+                  & empsr2(jpi,jpj), &
+                  & bfruar1(jpi,jpj),&
+                  & bfrvar1(jpi,jpj),&
+                  & bfruar2(jpi,jpj),&
+                  & bfrvar2(jpi,jpj) &
+                  & )
+
+               ALLOCATE( &
+                  & unr1(jpi,jpj,jpk),     &
+                  & vnr1(jpi,jpj,jpk),     &
+                  & tnr1(jpi,jpj,jpk),     &
+                  & snr1(jpi,jpj,jpk),     &
+                  & avmur1(jpi,jpj,jpk),   &
+                  & avmvr1(jpi,jpj,jpk),   &
+                  & avtr1(jpi,jpj,jpk),    &
+                  & etot3r1(jpi,jpj,jpk),  &
+                  & unr2(jpi,jpj,jpk),     &
+                  & vnr2(jpi,jpj,jpk),     &
+                  & tnr2(jpi,jpj,jpk),     &
+                  & snr2(jpi,jpj,jpk),     &
+                  & avmur2(jpi,jpj,jpk),   &
+                  & avmvr2(jpi,jpj,jpk),   &
+                  & avtr2(jpi,jpj,jpk),    &
+                  & etot3r2(jpi,jpj,jpk)   &
+                  & )
 #if defined key_traldf_eiv
 #if defined key_traldf_c3d
 #elif defined key_traldf_c2d
-            ALLOCATE( &
-               & aeiur1(jpi,jpj), &
-               & aeivr1(jpi,jpj), &
-               & aeiwr1(jpi,jpj), &
-               & aeiur2(jpi,jpj), &
-               & aeivr2(jpi,jpj), &
-               & aeiwr2(jpi,jpj)  &
-               & )
+               ALLOCATE( &
+                  & aeiur1(jpi,jpj), &
+                  & aeivr1(jpi,jpj), &
+                  & aeiwr1(jpi,jpj), &
+                  & aeiur2(jpi,jpj), &
+                  & aeivr2(jpi,jpj), &
+                  & aeiwr2(jpi,jpj)  &
+                  & )
 #elif defined key_traldf_c1d
 #endif
@@ -265,31 +265,31 @@
 
 #if defined key_ldfslp
-            ALLOCATE( &
-               & uslpr1(jpi,jpj,jpk),   &
-               & vslpr1(jpi,jpj,jpk),   &
-               & wslpir1(jpi,jpj,jpk),  &
-               & wslpjr1(jpi,jpj,jpk),  &
-               & uslpr2(jpi,jpj,jpk),   &
-               & vslpr2(jpi,jpj,jpk),   &
-               & wslpir2(jpi,jpj,jpk),  &
-               & wslpjr2(jpi,jpj,jpk)   &
-               & )
+               ALLOCATE( &
+                  & uslpr1(jpi,jpj,jpk),   &
+                  & vslpr1(jpi,jpj,jpk),   &
+                  & wslpir1(jpi,jpj,jpk),  &
+                  & wslpjr1(jpi,jpj,jpk),  &
+                  & uslpr2(jpi,jpj,jpk),   &
+                  & vslpr2(jpi,jpj,jpk),   &
+                  & wslpir2(jpi,jpj,jpk),  &
+                  & wslpjr2(jpi,jpj,jpk)   &
+                  & )
 #endif
 
 #if defined key_zdfddm
-            ALLOCATE( &
-               & avsr1(jpi,jpj,jpk),    &
-               & avsr2(jpi,jpj,jpk)     &
-               & )
+               ALLOCATE( &
+                  & avsr1(jpi,jpj,jpk),    &
+                  & avsr2(jpi,jpj,jpk)     &
+                  & )
 #endif
 
 #if defined key_tradmp
-            ALLOCATE( &
-               & hmlp1(jpi,jpj),    &
-               & hmlp2(jpi,jpj)     &
-               & )
-#endif
-	    ln_mem = .TRUE.
-
+               ALLOCATE( &
+                  & hmlp1(jpi,jpj),    &
+                  & hmlp2(jpi,jpj)     &
+                  & )
+#endif
+               ln_mem = .TRUE.
+            ENDIF
          ENDIF
 
