| 1 | MODULE writerestart1D_mod |
|---|
| 2 | |
|---|
| 3 | implicit none |
|---|
| 4 | |
|---|
| 5 | contains |
|---|
| 6 | |
|---|
| 7 | SUBROUTINE writerestart1D(filename,psurf,tsurf,nlayer,nslope,temp,u,v,nq,qnames,qsurf,q) |
|---|
| 8 | |
|---|
| 9 | implicit none |
|---|
| 10 | |
|---|
| 11 | ! Arguments |
|---|
| 12 | character(len = *), intent(in) :: filename |
|---|
| 13 | integer, intent(in) :: nlayer, nq, nslope |
|---|
| 14 | real, intent(in) :: psurf |
|---|
| 15 | real, dimension(nslope), intent(in) :: tsurf |
|---|
| 16 | real, dimension(nlayer), intent(in) :: temp, u, v |
|---|
| 17 | real, dimension(nlayer,nq), intent(in) :: q |
|---|
| 18 | real, dimension(nq,nslope), intent(in) :: qsurf |
|---|
| 19 | character(len = *), dimension(nq), intent(in) :: qnames |
|---|
| 20 | |
|---|
| 21 | ! Local variables |
|---|
| 22 | integer :: i, j, il |
|---|
| 23 | |
|---|
| 24 | ! Write the data needed for a restart in "restart1D.txt" |
|---|
| 25 | open(1,file = filename,status = "replace",action = "write") |
|---|
| 26 | write(1,*) 'ps', psurf |
|---|
| 27 | do i = 1,nq |
|---|
| 28 | write(1,*) qnames(i), (qsurf(i,j), j = 1,nslope), (q(il,i), il = 1,nlayer) |
|---|
| 29 | enddo |
|---|
| 30 | write(1,*) 'u', (u(il), il = 1,nlayer) |
|---|
| 31 | write(1,*) 'v', (v(il), il = 1,nlayer) |
|---|
| 32 | write(1,*) 'teta', (tsurf(j), j = 1,nslope), (temp(il), il = 1,nlayer) |
|---|
| 33 | close(1) |
|---|
| 34 | |
|---|
| 35 | END SUBROUTINE writerestart1D |
|---|
| 36 | |
|---|
| 37 | END MODULE writerestart1D_mod |
|---|