New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
makebdy_tc7.py in NEMO/trunk/tests/WAD/EXPREF – NEMO

source: NEMO/trunk/tests/WAD/EXPREF/makebdy_tc7.py @ 12377

Last change on this file since 12377 was 12377, checked in by acc, 4 years ago

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge --ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The --ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

File size: 2.0 KB
Line 
1from netCDF4 import Dataset
2import numpy as np
3
4pathout = "bdyssh_tc7"
5
6nx = 23 
7ny = 1
8nt = 24
9ndays=4
10
11#-------------------------------------------------------
12# Create bdyssh_tc7_m01d01.nc, bdyssh_tc7_m01d02.nc etc.
13#-------------------------------------------------------
14
15pathstart="{}_m12d30.nc".format(pathout)
16for nd in range(ndays):
17 print pathstart
18 ssh = np.zeros((nt,ny,nx))
19 for nnt in range(nd*nt,(nd+1)*nt):
20   tx = 2.5*np.cos((3.141592654/6.0)*(nnt))
21   print nnt, tx
22   for nnx in range(nx):
23     for nny in range(ny):
24       ssh[nnt-nd*nt,nny,nnx] = tx
25
26
27 fo = Dataset(pathstart, 'w', format='NETCDF4')
28 nxo = fo.createDimension('x', nx)
29 nyo = fo.createDimension('y', ny)
30 nto = fo.createDimension('t', None)
31 ssho = fo.createVariable('sshbdy', 'f4',('t','y','x'))
32
33 ssho[:,:,:] = ssh[:,:,:]
34 ssho.long_name = 'bdy ssh boundary condition'
35 ssho.standard_name = 'sshbdy'
36 ssho.units = 'm'
37#
38 fo.close()
39 pathstart="{}_m01d{:0>2d}.nc".format(pathout,nd+1)
40
41#-------------------------------------------------------
42# Create bdyuv_tc7_m01d01.nc, bdyuv_tc7_m01d02.nc etc.
43# u is -(1/H)*d(ssh)/dt; v =0.0
44#-------------------------------------------------------
45
46pathout = "bdyuv_tc7"
47
48
49pathstart="{}_m12d30.nc".format(pathout)
50for nd in range(ndays):
51 print pathstart
52 u = np.zeros((nt,ny,nx))
53 for nnt in range(nd*nt,(nd+1)*nt):
54  tx = 2.5*(3.141592654/6.0)*np.sin((3.141592654/6.0)*(nnt+1.0))/10.0
55  print nnt, tx
56  for nnx in range(nx):
57    for nny in range(ny):
58       u[nnt-nd*nt,nny,nnx] = tx
59
60 v = np.zeros((nt,ny,nx))
61
62 fo = Dataset(pathstart, 'w', format='NETCDF4')
63 nxo = fo.createDimension('x', nx)
64 nyo = fo.createDimension('y', ny)
65 nto = fo.createDimension('t', None)
66 uo = fo.createVariable('ubdy', 'f4',('t','y','x'))
67 vo = fo.createVariable('vbdy', 'f4',('t','y','x'))
68
69 uo[:,:,:] = u[:,:,:]
70 uo.long_name = 'bdy u boundary condition'
71 uo.standard_name = 'ubdy'
72 uo.units = 'm/s'
73#
74 vo[:,:,:] = v[:,:,:]
75 vo.long_name = 'bdy v boundary condition'
76 vo.standard_name = 'vbdy'
77 vo.units = 'm/s'
78#
79 fo.close()
80 pathstart="{}_m01d{:0>2d}.nc".format(pathout,nd+1)
Note: See TracBrowser for help on using the repository browser.