source: trunk/LMDZ.MARS/libf/phymars/dyn1d/writerestart1D.F90 @ 3051

Last change on this file since 3051 was 3051, checked in by jbclement, 16 months ago

Mars PCM 1D:
Addition of the file "start1D.txt" which mimics a "start.nc" file to be able to run chained simulations in 1D. Like this, key variables and profiles can be got from one run to the next. As a consequence, the subroutine "write_profile.F90" is replaced by "writerestart1D.F90".
JBC

File size: 883 bytes
Line 
1SUBROUTINE writerestart1D(psurf,tsurf,nlayer,temp,u,v,nq,qnames,qsurf,q)
2
3implicit none
4
5! Arguments
6integer, intent(in)                           :: nlayer, nq
7real, intent(in)                              :: psurf, tsurf
8real, dimension(nlayer), intent(in)           :: temp, u, v
9real, dimension(nlayer,nq), intent(in)        :: q
10real, dimension(nq), intent(in)               :: qsurf
11character(len = *), dimension(nq), intent(in) :: qnames
12
13! Local variables
14integer :: il, iq
15
16! Write the data needed for a restart in "restart1D.txt"
17open(1,file = 'restart1D.txt',status = "replace",action = "write")
18do iq = 1,nq
19    write(1,*) qnames(iq), qsurf(iq), (q(il,iq), il = 1,nlayer)
20enddo
21write(1,*) 'ps', psurf
22write(1,*) 'u', (u(il), il = 1,nlayer)
23write(1,*) 'v', (v(il), il = 1,nlayer)
24write(1,*) 'teta', tsurf, (temp(il), il = 1,nlayer)
25close(1)
26
27END SUBROUTINE writerestart1D
Note: See TracBrowser for help on using the repository browser.