19 LOGICAL :: lasym = .true.
20 LOGICAL :: lrecon = .true.
21 LOGICAL :: lcolscale = .true.
22 LOGICAL :: ladd_pert = .true.
23 LOGICAL :: lresistive = .true.
24 LOGICAL :: lrestart = .false.
25 INTEGER :: niter = 100
27 INTEGER :: mpolin = 12
29 REAL (rprec) :: ftol = 1.0e-20
30 REAL (rprec) :: levmarq_param = 3.0e-2
31 REAL (rprec) :: mupar = 1.0e-3
32 CHARACTER (len=100) ::
33 'wout_154921.02530.asym.ntor1.nc'
34 CHARACTER (len=100) :: restart_ext =
'restart_cth_'
35 INTEGER,
DIMENSION(10) :: mres
36 REAL (rprec),
DIMENSION(10) :: helpert
39 & lasym, lrecon, lcolscale, ladd_pert, lresistive, lrestart,
40 & niter, nsin, mpolin, ntorin, ftol, levmarq_param, mupar,
41 & wout_file, restart_ext, mres, helpert
66 REAL (rprec) :: p_factor
73 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: pmnch => null()
75 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: pmnsh => null()
78 REAL (rprec) :: b_factor
81 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsupsmnch => null()
83 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsupsmnsh => null()
85 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsupumnch => null()
87 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsupumnsh => null()
89 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsupvmnch => null()
91 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsupvmnsh => null()
94 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsubsmnch => null()
96 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsubsmnsh => null()
98 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsubumnch => null()
100 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsubumnsh => null()
102 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsubvmnch => null()
104 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: bsubvmnsh => null()
107 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: jksupsmncf => null()
109 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: jksupsmnsf => null()
111 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: jksupumncf => null()
113 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: jksupumnsf => null()
115 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: jksupvmncf => null()
117 REAL (rprec),
DIMENSION(:,:,:),
POINTER :: jksupvmnsf => null()
140 CHARACTER (len=*),
INTENT(in) :: restart_file_name
150 REAL (rprec) :: start_time
153 INTEGER,
PARAMETER :: l_asym_flag = 31
160 CALL cdf_open(ncid, trim(restart_file_name),
'r', status)
162 CALL cdf_read(ncid,
'nrad', ns)
163 CALL cdf_read(ncid,
'mpol', mpol)
164 CALL cdf_read(ncid,
'ntor', ntor)
170 CALL cdf_read(ncid,
'state_flags', flags)
180 CALL cdf_read(ncid,
'pmnch(m,n,r)',
188 CALL cdf_read(ncid,
'bsupsmnsh(m,n,r)',
191 CALL cdf_read(ncid,
'bsupumnch(m,n,r)',
194 CALL cdf_read(ncid,
'bsupvmnch(m,n,r)',
199 CALL cdf_read(ncid,
'bsubsmnsh(m,n,r)',
202 CALL cdf_read(ncid,
'bsubumnch(m,n,r)',
205 CALL cdf_read(ncid,
'bsubvmnch(m,n,r)',
211 CALL cdf_read(ncid,
'jksupsmnsf(m,n,r)',
215 CALL cdf_read(ncid,
'jksupumncf(m,n,r)',
219 CALL cdf_read(ncid,
'jksupvmncf(m,n,r)',
225 CALL cdf_read(ncid,
'pmnsh(m,n,r)',
231 CALL cdf_read(ncid,
'bsupsmnch(m,n,r)',
235 CALL cdf_read(ncid,
'bsupumnsh(m,n,r)',
239 CALL cdf_read(ncid,
'bsupvmnsh(m,n,r)',
245 CALL cdf_read(ncid,
'bsubsmnch(m,n,r)',
249 CALL cdf_read(ncid,
'bsubumnsh(m,n,r)',
253 CALL cdf_read(ncid,
'bsubvmnsh(m,n,r)',
259 CALL cdf_read(ncid,
'jksupsmncf(m,n,r)',
263 CALL cdf_read(ncid,
'jksupumnsf(m,n,r)',
267 CALL cdf_read(ncid,
'jksupvmnsf(m,n,r)',
293 TYPE (siesta_context_class),
POINTER :: this
296 IF (
ASSOCIATED(this%pmnch))
THEN
297 DEALLOCATE(this%pmnch)
301 IF (
ASSOCIATED(this%pmnsh))
THEN
302 DEALLOCATE(this%pmnsh)
306 IF (
ASSOCIATED(this%bsupsmnsh))
THEN
307 DEALLOCATE(this%bsupsmnsh)
308 this%bsupsmnsh => null()
311 IF (
ASSOCIATED(this%bsupsmnch))
THEN
312 DEALLOCATE(this%bsupsmnch)
313 this%bsupsmnch => null()
316 IF (
ASSOCIATED(this%bsupumnsh))
THEN
317 DEALLOCATE(this%bsupumnsh)
318 this%bsupumnsh => null()
321 IF (
ASSOCIATED(this%bsupumnch))
THEN
322 DEALLOCATE(this%bsupumnch)
323 this%bsupumnch => null()
326 IF (
ASSOCIATED(this%bsupvmnsh))
THEN
327 DEALLOCATE(this%bsupvmnsh)
328 this%bsupvmnsh => null()
331 IF (
ASSOCIATED(this%bsupvmnch))
THEN
332 DEALLOCATE(this%bsupvmnch)
333 this%bsupvmnch => null()
336 IF (
ASSOCIATED(this%bsubsmnsh))
THEN
337 DEALLOCATE(this%bsubsmnsh)
338 this%bsubsmnsh => null()
341 IF (
ASSOCIATED(this%bsubsmnch))
THEN
342 DEALLOCATE(this%bsubsmnch)
343 this%bsubsmnch => null()
346 IF (
ASSOCIATED(this%bsubumnsh))
THEN
347 DEALLOCATE(this%bsubumnsh)
348 this%bsubumnsh => null()
351 IF (
ASSOCIATED(this%bsubumnch))
THEN
352 DEALLOCATE(this%bsubumnch)
353 this%bsubumnch => null()
356 IF (
ASSOCIATED(this%bsubvmnsh))
THEN
357 DEALLOCATE(this%bsubvmnsh)
358 this%bsubvmnsh => null()
361 IF (
ASSOCIATED(this%bsubvmnch))
THEN
362 DEALLOCATE(this%bsubvmnch)
363 this%bsubvmnch => null()
366 IF (
ASSOCIATED(this%jksupsmnsf))
THEN
367 DEALLOCATE(this%jksupsmnsf)
368 this%jksupsmnsf => null()
371 IF (
ASSOCIATED(this%jksupsmncf))
THEN
372 DEALLOCATE(this%jksupsmncf)
373 this%jksupsmncf => null()
376 IF (
ASSOCIATED(this%jksupumnsf))
THEN
377 DEALLOCATE(this%jksupumnsf)
378 this%jksupumnsf => null()
381 IF (
ASSOCIATED(this%jksupumncf))
THEN
382 DEALLOCATE(this%jksupumncf)
383 this%jksupumncf => null()
386 IF (
ASSOCIATED(this%jksupvmnsf))
THEN
387 DEALLOCATE(this%jksupvmnsf)
388 this%jksupvmnsf => null()
391 IF (
ASSOCIATED(this%jksupvmncf))
THEN
392 DEALLOCATE(this%jksupvmncf)
393 this%jksupvmncf => null()
418 TYPE (siesta_context_class),
POINTER :: this
419 CHARACTER (len=*),
INTENT(in) :: restart_file_name
426 CHARACTER (len=path_length) :: wout_file_name
427 REAL (rprec) :: start_time
430 INTEGER,
PARAMETER :: l_asym_flag = 31
435 CALL cdf_open(ncid, trim(restart_file_name),
'r', status)
436 IF (status .ne. 0) stop
'Failed'
438 CALL cdf_read(ncid,
'nrad', this%ns)
439 CALL cdf_read(ncid,
'mpol', this%mpol)
440 CALL cdf_read(ncid,
'ntor', this%ntor)
442 CALL cdf_read(ncid,
'state_flags', flags)
443 IF (this%l_asym .neqv. btest(flags, l_asym_flag))
THEN
444 stop
'Restart file changed parity.'
448 CALL cdf_read(ncid,
'p_factor', this%p_factor)
450 CALL cdf_read(ncid,
'p_min', this%p_min)
451 CALL cdf_read(ncid,
'p_max', this%p_max)
453 CALL cdf_read(ncid,
'pmnch(m,n,r)', this%pmnch)
456 CALL cdf_read(ncid,
'b_factor', this%b_factor)
459 CALL cdf_read(ncid,
'bsupsmnsh(m,n,r)', this%bsupsmnsh)
460 CALL cdf_read(ncid,
'bsupumnch(m,n,r)', this%bsupumnch)
461 CALL cdf_read(ncid,
'bsupvmnch(m,n,r)', this%bsupvmnch)
464 CALL cdf_read(ncid,
'bsubsmnsh(m,n,r)', this%bsubsmnsh)
465 CALL cdf_read(ncid,
'bsubumnch(m,n,r)', this%bsubumnch)
466 CALL cdf_read(ncid,
'bsubvmnch(m,n,r)', this%bsubvmnch)
469 CALL cdf_read(ncid,
'jksupsmnsf(m,n,r)', this%jksupsmnsf)
470 CALL cdf_read(ncid,
'jksupumncf(m,n,r)', this%jksupumncf)
471 CALL cdf_read(ncid,
'jksupvmncf(m,n,r)', this%jksupvmncf)
473 IF (this%l_asym)
THEN
475 CALL cdf_read(ncid,
'pmnsh(m,n,r)', this%pmnsh)
478 CALL cdf_read(ncid,
'bsupsmnch(m,n,r)', this%bsupsmnch)
479 CALL cdf_read(ncid,
'bsupumnsh(m,n,r)', this%bsupumnsh)
480 CALL cdf_read(ncid,
'bsupvmnsh(m,n,r)', this%bsupvmnsh)
483 CALL cdf_read(ncid,
'bsubsmnch(m,n,r)', this%bsubsmnch)
484 CALL cdf_read(ncid,
'bsubumnsh(m,n,r)', this%bsubumnsh)
485 CALL cdf_read(ncid,
'bsubvmnsh(m,n,r)', this%bsubvmnsh)
488 CALL cdf_read(ncid,
'jksupsmncf(m,n,r)', this%jksupsmncf)
489 CALL cdf_read(ncid,
'jksupumnsf(m,n,r)', this%jksupumnsf)
490 CALL cdf_read(ncid,
'jksupvmnsf(m,n,r)', this%jksupvmnsf)