/[MITgcm]/MITgcm_contrib/mlosch/optim_m1qn3/optim_store_m1qn3.F
ViewVC logotype

Annotation of /MITgcm_contrib/mlosch/optim_m1qn3/optim_store_m1qn3.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (hide annotations) (download)
Wed May 2 20:15:16 2012 UTC (13 years, 3 months ago) by mlosch
Branch: MAIN
Changes since 1.3: +8 -6 lines
include even more variable in the storage scheme (indica,indicd,t_increase)

1 mlosch 1.4 C $Header: /u/gcmpack/MITgcm_contrib/mlosch/optim_m1qn3/optim_store_m1qn3.F,v 1.3 2012/05/02 10:10:57 mlosch Exp $
2 mlosch 1.2 C $Name: $
3 mlosch 1.1
4     subroutine optim_store_m1qn3(
5     I ndz,
6     U iz,dz,niter,nsim,epsg,df1,
7     I optimcycle,
8     I store)
9     c
10     c subroutine optim_store_m1qn3
11     c
12     c Depending on the parameter store, store or restore the state of
13     c m1qn3. The communication is mostly via common blocks in order
14     c to keep the changes to m1qn3 to a minimum. Only iz and dz are passed
15     c as arguments
16     c
17     implicit none
18     c-- global variables
19     #include "m1qn3_common.h"
20     #include "m1qn3a_common.h"
21     #include "mlis3_common.h"
22     c-- routine arguments
23     integer ndz
24     integer iz(5)
25     _RL dz(ndz)
26     integer niter, nsim
27     _RL epsg,df1
28     integer optimcycle
29     logical store
30    
31     c-- local variables
32     integer io, k
33     character*(14) fname
34    
35     c-- routine body
36     fname = ' '
37     io = 99
38     print *, 'ml-optimcycle', optimcycle
39     if ( store ) then
40     write(fname,'(A,I4.4)') 'OPWARM.opt',optimcycle+1
41     c
42     print *
43     print *, ' OPTIM_STORE_M1QN3: saving the state of m1qn3 in ',
44     & fname
45     print *
46     c
47     open(io,file=fname,form='unformatted',status='unknown')
48     write(io) niter,nsim
49     write(io) iz
50     write(io) (dz(k),k=1,ndz)
51     c some extra info
52     write(io) epsg,df1
53     c m1qn3_common.h
54     write(io) inmemo,id,igg,idiag,iaux,ialpha,iybar,isbar,reentry
55     c m1qn3a_common.h
56     write(io) cold,warm,itmax,isim,jcour,d1,t,tmin,tmax,
57 mlosch 1.3 & gnorm,gnorms,eps1,ff,preco,precos,ys,den,dk,dk1,ps,ps2,hp0
58 mlosch 1.1 c mlis3_common.h
59 mlosch 1.4 write(io) t_increased,indica,indicd
60 mlosch 1.2 write(io) tesf,tesd,fa,fpa,fn,barmin,barmul,barmax,barr,
61     & tg,fg,fpg,td,ta,d2,fp,ffn,fd,fpd,z,test,gauche,droite
62 mlosch 1.1 else
63     write(fname,'(A,I4.4)') 'OPWARM.opt',optimcycle
64     c
65     print *
66     print *, ' OPTIM_STORE_M1QN3: restoring the state'//
67     & ' of m1qn3 from ', fname
68     print *
69     c
70     open(io,file=fname,form='unformatted',status='old')
71     read(io) niter,nsim
72 mlosch 1.4 read(io) iz
73     read(io) (dz(k),k=1,ndz)
74 mlosch 1.1 c some extra info
75 mlosch 1.4 read(io) epsg,df1
76 mlosch 1.1 c m1qn3_common.h
77 mlosch 1.4 read(io) inmemo,id,igg,idiag,iaux,ialpha,iybar,isbar,reentry
78 mlosch 1.1 c m1qn3a_common.h
79 mlosch 1.3 read(io) cold,warm,itmax,isim,jcour,d1,t,tmin,tmax,
80     & gnorm,gnorms,eps1,ff,preco,precos,ys,den,dk,dk1,ps,ps2,hp0
81 mlosch 1.1 c mlis3_common.h
82 mlosch 1.4 read(io) t_increased,indica,indicd
83     read(io) tesf,tesd,fa,fpa,fn,barmin,barmul,barmax,barr,
84 mlosch 1.2 & tg,fg,fpg,td,ta,d2,fp,ffn,fd,fpd,z,test,gauche,droite
85 mlosch 1.1 endif
86    
87     close(io)
88    
89     return
90     end

  ViewVC Help
Powered by ViewVC 1.1.22