/[lmdze]/trunk/Sources/misc/createnewfield.f
ViewVC logotype

Annotation of /trunk/Sources/misc/createnewfield.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 145 - (hide annotations)
Tue Jun 16 15:23:29 2015 UTC (8 years, 11 months ago) by guez
File size: 1364 byte(s)
Renamed bibio to misc.

In procedure fxhyp, use the fact that xf is an odd function of xtild.

In procedure invert_zoom_x, replace linear search in xf by
bisection. Also, use result from previous loop iteration as initial
guess. Variable "it" cannot be equal to 2 * nmax after search.

Unused arguments: hm of cv3_feed; ph, qnk, tv,tvp of cv3_mixing; ppsol
of lw; rconst, temp of vdif_kcay; rconst, plev, temp, ustar, l_mix of
yamada.

1 guez 108 module createnewfield_m
2    
3     implicit none
4    
5 guez 110 integer, parameter:: MaxWriteField = 100
6     character(len=255), save:: FieldName(MaxWriteField)
7     integer:: NbField = 0
8     integer, save:: Ncid(MaxWriteField)
9    
10 guez 108 contains
11    
12 guez 109 subroutine CreateNewField(name, my_shape)
13 guez 108
14     USE netcdf, ONLY: nf90_clobber, nf90_double, nf90_unlimited
15     USE netcdf95, ONLY: nf95_create, nf95_def_dim, nf95_def_var, nf95_enddef
16    
17     character(len = *), intent(in):: name
18 guez 109 integer, intent(in):: my_shape(:)
19 guez 108
20     ! Local:
21 guez 110 integer Dimid(size(my_shape) + 1), n_dim, varid
22 guez 108
23     !--------------------------------------------------------------------
24    
25     NbField = NbField + 1
26 guez 109 FieldName(NbField) = ADJUSTL(name)
27     n_dim = size(my_shape)
28 guez 108
29 guez 109 call NF95_CREATE(TRIM(FieldName(NbField)) // '.nc', NF90_CLOBBER, &
30     Ncid(NbField))
31     call NF95_DEF_DIM(Ncid(NbField), 'X', my_shape(1), Dimid(1))
32     if (n_dim >= 2) then
33     call NF95_DEF_DIM(Ncid(NbField), 'Y', my_shape(2), Dimid(2))
34     if (n_dim >= 3) then
35     call NF95_DEF_DIM(Ncid(NbField), 'Z', my_shape(3), Dimid(3))
36     end if
37     end if
38     call NF95_DEF_DIM(Ncid(NbField), 'iter', NF90_UNLIMITED, Dimid(n_dim + 1))
39 guez 110 call NF95_DEF_VAR(Ncid(NbField), FieldName(NbField), NF90_DOUBLE, Dimid, &
40     Varid)
41 guez 109 call NF95_ENDDEF(Ncid(NbField))
42 guez 108
43     end subroutine CreateNewField
44    
45     end module createnewfield_m

  ViewVC Help
Powered by ViewVC 1.1.21