Changeset 1975
- Timestamp:
- Feb 14, 2014, 10:42:27 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phy1d/1DUTILS.h
r1960 r1975 746 746 RETURN 747 747 END 748 subroutine wrgradsfi(if,nl,field,name,titlevar)749 implicit none750 751 ! Declarations752 753 #include "gradsdef.h"754 755 ! arguments756 integer if,nl757 real field(imx*jmx*lmx)758 character*10 name,file759 character*10 titlevar760 761 ! local762 763 integer im,jm,lm,i,j,l,iv,iii,iji,iif,ijf764 765 logical writectl766 767 768 writectl=.false.769 770 ! print*,if,iid(if),jid(if),ifd(if),jfd(if)771 iii=iid(if)772 iji=jid(if)773 iif=ifd(if)774 ijf=jfd(if)775 im=iif-iii+1776 jm=ijf-iji+1777 lm=lmd(if)778 779 780 ! print*,'im,jm,lm,name,firsttime(if)'781 ! print*,im,jm,lm,name,firsttime(if)782 783 if(firsttime(if)) then784 if(name.eq.var(1,if)) then785 firsttime(if)=.false.786 ivar(if)=1787 print*,'fin de l initialiation de l ecriture du fichier'788 print*,file789 print*,'fichier no: ',if790 print*,'unit ',unit(if)791 print*,'nvar ',nvar(if)792 print*,'vars ',(var(iv,if),iv=1,nvar(if))793 else794 ivar(if)=ivar(if)+1795 nvar(if)=ivar(if)796 var(ivar(if),if)=name797 tvar(ivar(if),if)=trim(titlevar)798 nld(ivar(if),if)=nl799 print*,'initialisation ecriture de ',var(ivar(if),if)800 print*,'if ivar(if) nld ',if,ivar(if),nld(ivar(if),if)801 endif802 writectl=.true.803 itime(if)=1804 else805 ivar(if)=mod(ivar(if),nvar(if))+1806 if (ivar(if).eq.nvar(if)) then807 writectl=.true.808 itime(if)=itime(if)+1809 endif810 811 if(var(ivar(if),if).ne.name) then812 print*,'Il faut stoker la meme succession de champs a chaque'813 print*,'pas de temps'814 print*,'fichier no: ',if815 print*,'unit ',unit(if)816 print*,'nvar ',nvar(if)817 print*,'vars ',(var(iv,if),iv=1,nvar(if))818 819 stop820 endif821 endif822 823 ! print*,'ivar(if),nvar(if),var(ivar(if),if),writectl'824 ! print*,ivar(if),nvar(if),var(ivar(if),if),writectl825 do l=1,nl826 irec(if)=irec(if)+1827 ! print*,'Ecrit rec=',irec(if),iii,iif,iji,ijf,828 ! s (l-1)*imd(if)*jmd(if)+(iji-1)*imd(if)+iii829 ! s ,(l-1)*imd(if)*jmd(if)+(ijf-1)*imd(if)+iif830 write(unit(if)+1,rec=irec(if))831 s ((field((l-1)*imd(if)*jmd(if)+(j-1)*imd(if)+i)832 s ,i=iii,iif),j=iji,ijf)833 enddo834 if (writectl) then835 836 file=fichier(if)837 ! WARNING! on reecrase le fichier .ctl a chaque ecriture838 open(unit(if),file=trim(file)//'.ctl',839 & form='formatted',status='unknown')840 write(unit(if),'(a5,1x,a40)')841 & 'DSET ','^'//trim(file)//'.dat'842 843 write(unit(if),'(a12)') 'UNDEF 1.0E30'844 write(unit(if),'(a5,1x,a40)') 'TITLE ',title(if)845 call formcoord(unit(if),im,xd(iii,if),1.,.false.,'XDEF')846 call formcoord(unit(if),jm,yd(iji,if),1.,.true.,'YDEF')847 call formcoord(unit(if),lm,zd(1,if),1.,.false.,'ZDEF')848 write(unit(if),'(a4,i10,a30)')849 & 'TDEF ',itime(if),' LINEAR 07AUG1998 30MN '850 write(unit(if),'(a4,2x,i5)') 'VARS',nvar(if)851 do iv=1,nvar(if)852 ! print*,'if,var(iv,if),nld(iv,if),nld(iv,if)-1/nld(iv,if)'853 ! print*,if,var(iv,if),nld(iv,if),nld(iv,if)-1/nld(iv,if)854 write(unit(if),1000) var(iv,if),nld(iv,if)-1/nld(iv,if)855 & ,99,tvar(iv,if)856 enddo857 write(unit(if),'(a7)') 'ENDVARS'858 !859 1000 format(a5,3x,i4,i3,1x,a39)860 861 close(unit(if))862 863 endif ! writectl864 865 return866 867 END868 748 869 749 subroutine inigrads(if,im
Note: See TracChangeset
for help on using the changeset viewer.