getm-2.2_getm-2.3.converter 1.91 KB
Newer Older
Knut's avatar
Knut committed
1
<?xml version="1.0" ?>
Knut's avatar
Knut committed
2 3
<converter source="getm-2.2" target="getm-2.3">
	<links>
4
		<link source="/getm/meteo/spinup" target="/getm/meteo/meteo_ramp"/>
Knut's avatar
Knut committed
5 6
		<link source="/getm/m2d/vel_depth_method" target="/getm/domain/vel_depth_method"/>
	</links>
7 8 9 10 11 12 13 14
	<custom>
		<forward>
<![CDATA[
nmls_s = ('getm/m3d/vel_'  ,'getm/temp/temp_','getm/salt/salt_')
nmls_t = ('getm/m3d/vel3d_','getm/temp/temp_','getm/salt/salt_')
for n,nml in enumerate(nmls_s):
	adv_split = source[nml+'adv_split'].getValue(usedefault=True)
	hor_adv = source[nml+'hor_adv'].getValue(usedefault=True)
15
	ver_adv = source[nml+'ver_adv'].getValue(usedefault=True)
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
	target[nmls_t[n]+'adv_split'].setValue(adv_split+1)
	target[nmls_t[n]+'adv_hor'].setValue(hor_adv)
	target[nmls_t[n]+'adv_ver'].setValue(ver_adv)
	if hor_adv == 1:
		target[nmls_t[n]+'adv_split'].setValue(0)
		target[nmls_t[n]+'adv_ver'].setValue(1)
	elif hor_adv == 2:
		if adv_split in (0,1):
			target[nmls_t[n]+'adv_hor'].setValue(1)
	elif hor_adv == 7:
		target[nmls_t[n]+'adv_hor'].setValue(8)
	if ver_adv == 2:
		target[nmls_t[n]+'adv_ver'].setValue(1)
]]>
		</forward>
		<backward>
<![CDATA[
nmls_s = ('getm/m3d/vel3d_','getm/temp/temp_','getm/salt/salt_')
nmls_t = ('getm/m3d/vel_'  ,'getm/temp/temp_','getm/salt/salt_')
for n,nml in enumerate(nmls_s):
	adv_split = source[nml+'adv_split'].getValue(usedefault=True)
	adv_hor = source[nml+'adv_hor'].getValue(usedefault=True)
	adv_ver = source[nml+'adv_ver'].getValue(usedefault=True)
	target[nmls_t[n]+'hor_adv'].setValue(adv_hor)
	target[nmls_t[n]+'ver_adv'].setValue(adv_ver)
	if adv_split == 0:
		if adv_hor in (2,7,8,9):
			target[nmls_t[n]+'adv_split'].setValue(2)
	else:
		target[nmls_t[n]+'adv_split'].setValue(adv_split-1)
	if adv_hor == 1:
		if adv_split in (1,2):
			target[nmls_t[n]+'hor_adv'].setValue(2)
	if adv_hor == 8:
		target[nmls_t[n]+'hor_adv'].setValue(7)
	if adv_ver == 1:
		target[nmls_t[n]+'ver_adv'].setValue(2)
]]>
		</backward>
	</custom>
Knut's avatar
Knut committed
56
</converter>