diff --git a/couplage/MAR/call_caraib.f90 b/couplage/MAR/call_caraib.f90 index 0368fc41d2934360322a748d6409d66dad28fa05..039b11fb4c821813bcafc10e0788e5777312526e 100644 --- a/couplage/MAR/call_caraib.f90 +++ b/couplage/MAR/call_caraib.f90 @@ -21,6 +21,7 @@ use mardim use marcar use mar_ge + use mar_vb IMPLICIT NONE @@ -93,9 +94,38 @@ ! +--CASES called in iniglf.f90 ! + ========================== ! + - + ! check if a .nc exists CASE(10) INQUIRE(FILE="MARglf.nc", EXIST=file_exists) + + CASE(11) + if (file_exists) then + call CF_READ2D('MARglf.nc','LAI',1,mx,my,nvx,lai_caraib) + call CF_READ2D('MARglf.nc','GLF',1,mx,my,nvx,glf_caraib) + else + open(unit=11, status='old', form='unformatted', file='MARglf.DAT') + rewind 11 + endif + ! Read th NESTOR file of CARAIB file dependinf on the coupling + CASE(12) + if (file_exists) then + glf2VB=glf_caraib + LAI2VB=lai_caraib + + iyr_VB = iyrrGE + mma_VB = mmarGE + jda_VB = jdarGE + jhu_VB = jhurGE +1 + + !!!!!!!!!!!!!!!!!!! + jdh_VB = 6 ! temps entre 2 forçage --> hard codé ici + !!!!!!!!!!!!!!!!!!! + else + read(11) iyr_VB, mma_VB, jda_VB, jhu_VB, jdh_VB + read(11) glf2VB + + read(11) LAI2VB + endif CASE DEFAULT write(6, *) "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" diff --git a/couplage/MAR/iniglf.f90 b/couplage/MAR/iniglf.f90 index 987d839c832b62990f2fa48fd563650c3c18e2d7..1c4c9d496dc45a3cc72f9044e46b4735590cdcf4 100644 --- a/couplage/MAR/iniglf.f90 +++ b/couplage/MAR/iniglf.f90 @@ -114,14 +114,12 @@ subroutine INIglf(ihamr_glf, nhamr_glf, newglfINI) if(jdh_VB == 0) jdh_VB = -1 - if (.not. file_exists .or. .not. CARcoupling) then - open(unit=11, status='old', form='unformatted', file='MARglf.DAT') - rewind 11 + ! Read th NESTOR file of CARAIB file dependinf on the coupling + if (CARcoupling .eq. .true.) then + call call_caraib(11) else - - call CF_READ2D('MARglf.nc','LAI',1,mx,my,nvx,lai_caraib) - call CF_READ2D('MARglf.nc','GLF',1,mx,my,nvx,glf_caraib) - + open(unit=11, status='old', form='unformatted', file='MARglf.DAT') + rewind 11 endif 11 continue @@ -153,24 +151,14 @@ subroutine INIglf(ihamr_glf, nhamr_glf, newglfINI) ! + ---------------------------- ! + !On lit les infos dans le fichier - if (.not. file_exists) then - read(11) iyr_VB, mma_VB, jda_VB, jhu_VB, jdh_VB - read(11) glf2VB - - read(11) LAI2VB - - else - glf2VB=glf_caraib - LAI2VB=lai_caraib - - iyr_VB = iyrrGE - mma_VB = mmarGE - jda_VB = jdarGE - jhu_VB = jhurGE +1 + if (CARcoupling .eq. .true.) then + call call_caraib(12) - !!!!!!!!!!!!!!!!!!! - jdh_VB = 6 ! temps entre 2 forçage --> hard codé ici - !!!!!!!!!!!!!!!!!!! + else + read(11) iyr_VB, mma_VB, jda_VB, jhu_VB, jdh_VB + read(11) glf2VB + + read(11) LAI2VB endif ! +