XNS Shape Optimization
XNS shape optimization variant XNS-SOPT is a fusion of XNS with the optimization driver opti_mizer and the geometry kernel shade. The XNS component, including EWD, has its own branch in the version control system.
There is a old xns-sopt version, if you want this look here:
For the new XNS-SOPT version you can also take a look at the (internal) developer documentation in the shape optimization wiki .
Therefore do this:
svn checkout svn://hydra/xns svn checkout svn://hydra/opti_mizer svn checkout svn://hydra/shade svn checkout svn://hydra/ewd
RemarkOn hydra please use
#define SENDRECV 1in the file
ewdcomm.F, otherwise the mpi gets into a deadlock. Do not forget to comment the other two variants.
Please find the cases here:
svn checkout svn://hydra/validate-sopt
The basic behaviour is the same as "normal" xns. For the shape changes we updated the mixd format. Please look here:
svn checkout svn://hydra/tn-mixd-2.0
Guidelines to keep the code AD-friendly
There are some simple implementation "rules" that should be followed to ease the transformation of the code:
- Include either ewd.h or ewdcray.h whenever using cray pointers in other header files
or Fortran routines and declare them correctly as
integer (crayptr) :: myptr.
- Add an empty line at the end of each file.
- Check your declaration for unused variables and get rid of them.
- Avoid Fortran 90/95 statement
action="write"in the open command.
- Adress arrays with their correct dimension, i.e., fill the rows of the array
real*8 :: a(m,n)using
a(i,0) = data(i)or
a(:,0) = data(:)or
a(1:m,0) = data(1:m)instead of
a=data(i). Another example is using
- Do not label loops, i.e.,
- Use parameter attribute instead of preprocessor defines. Example: replace
# define JUST_FUNCTION 1by
integer, parameter :: JUST_FUNCTION = 1.
- Be consistent with data types (even if the compiler usually does not mind when you pass a logical to a subroutine that expects an integer; the other way around you might be in trouble anyway).